WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:
PR Number:

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)

29924.diff (664 bytes) - added by mboynes 5 years ago.
Ensure themes don't have to call add_image_size() to be used in unit tests

Download all attachments as: .zip

Change History (3)

@mboynes
5 years ago

Ensure themes don't have to call add_image_size() to be used in unit tests

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 4.1

#2 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 29874:

Ensure themes don't have to call add_image_size() to be used in unit tests.

props mboynes.
fixes #29924.

Note: See TracTickets for help on using tickets.