Make WordPress Core

Opened 23 months ago

Last modified 6 months ago

#37375 accepted defect (bug)

Several test setUp() methods don't call parent::setUp()

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.0 Priority: normal
Severity: minor Version:
Component: Build/Test Tools Keywords: has-patch commit
Focuses: Cc:


This needs verification and proper testing, but I noticed a bunch of test classes don't call parent::setUp() within their own setUp() methods.

Attachments (2)

37375.patch (3.3 KB) - added by johnbillion 23 months ago.
37375.2.diff (4.7 KB) - added by birgire 6 months ago.

Download all attachments as: .zip

Change History (7)

23 months ago

#1 @johnbillion
23 months ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to Future Release

#2 @Frank Klein
6 months ago

  • Keywords needs-testing removed

Could not find any issues on local.

#3 @johnbillion
6 months ago

  • Keywords commit added
  • Milestone changed from Future Release to 5.0
  • Owner set to johnbillion
  • Status changed from new to accepted

#4 @birgire
6 months ago

It looks like there are two more:


I also noticed that in:


a little mismatch in the method's name, i.e. Tests_Image_Editor::setup() instead of Tests_Image_Editor::setUp().

6 months ago

#5 @birgire
6 months ago

37375.2.diff adds the parent::setUp() call in

  • Tests_Taxonomy_GetObjectTaxonomies:setUp(),
  • Tests_WP_Embed:setUp().

Also includes the Tests_Image_Editor::setUp() instead of Tests_Image_Editor::setup().

For the two additional parent::setUp(), I tested:

phpunit --group taxonomy
OK (615 tests, 1424 assertions)

phpunit --group oembed
OK (104 tests, 290 assertions)

Note: See TracTickets for help on using tickets.