Skip to content

Commit b949c64

Browse files
committed
PR 2578 DB/RestrictedClasses: remove redundant call to parent::setUpPrerequisites()
Calling `AbstractSniffUnitTest::setUpPrerequisites()` manually inside `RestrictedClassesUnitTest::enhanceGroups()` is not necessary as this method already executes via its `@before` tag and results in the method running twice. Originally, `RestrictedClassesUnitTest::enhanceGroups()` was named `RestrictedClassesUnitTest::setUp()` and called `parent::setUp()` (https://github.com/WordPress/WordPress-Coding-Standards/blob/3b9ae92607295548df357e108fd27090cf89d1d7/WordPress/Tests/DB/RestrictedClassesUnitTest.php#L34-L35). But later it was renamed, and then it probably didn't make sense to continue calling `parent::setUp()` (which was later renamed to `setUpPrerequisites()`): WordPress@00b895c. I found this in the context of the work to prepare this codebase for PHPCS 4.0 as `AbstractSniffUnitTest::setUpPrerequisites()` was renamed in 4.0 (PHPCSStandards/PHP_CodeSniffer@92cf10f#diff-91ba2a2a923bbfdaa61dcd31051d783bd0e7ff99f979f6e1a2917cae7dde3eb2L58).
1 parent 0d8ce95 commit b949c64

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

WordPress/Tests/DB/RestrictedClassesUnitTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ final class RestrictedClassesUnitTest extends AbstractSniffTestCase {
3737
* @return void
3838
*/
3939
protected function enhanceGroups() {
40-
parent::setUpPrerequisites();
41-
4240
AbstractFunctionRestrictionsSniff::$unittest_groups = array(
4341
'test' => array(
4442
'type' => 'error',

0 commit comments

Comments
 (0)