Opened 10 years ago
Closed 10 years ago
#29924 closed defect (bug) (fixed)
Unit tests require that the theme call add_image_size()
Reported by: | mboynes | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | |
Focuses: | Cc: |
Description
Today I ran core's unit tests with Underscores active and ran into the following error:
1) Tests_Media::test_add_image_size PHPUnit_Framework_Exception: Argument #2 (No Value) of PHPUnit_Framework_Assert::assertArrayNotHasKey() must be a array or ArrayAccess /var/www/wordpress-develop/tests/phpunit/tests/media.php:416
It turns out the theme used for unit tests must call add_image_size()
, otherwise global $_wp_additional_image_sizes
is null.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Ensure themes don't have to call add_image_size() to be used in unit tests