Opened 10 years ago
Closed 8 years ago
#37375 closed defect (bug) (fixed)
Several test setUp() methods don't call parent::setUp()
| Reported by: | johnbillion | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Build/Test Tools | Version: | |
| Severity: | minor | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
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)
Change History (10)
#3
@
9 years ago
- Keywords commit added
- Milestone Future Release → 5.0
- Owner set to
- Status new → accepted
#4
@
9 years ago
It looks like there are two more:
tests/phpunit/tests/oembed/WpEmbed.php: tests/phpunit/tests/taxonomy/getObjectTaxonomies.php:
I also noticed that in:
tests/phpunit/tests/image/editor.php
a little mismatch in the method's name, i.e. Tests_Image_Editor::setup() instead of Tests_Image_Editor::setUp().
#5
@
9 years 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)
#7
@
8 years ago
This is looking good. I just checked the test suite again and appears there are no other functions missed. Good job, @birgire spotting those others.
I opened a PR on GitHub to run the full test suite.
I opened #45931 as a companion ticket for the instances where parent::tearDown() is not called.
Could not find any issues on local.