Skip to content

Commit b783a4e

Browse files
committed
DB/RestrictedClasses: remove unnecessary call to parent::setUpPrerequisites()
Calling `parent::setUpPrerequisites()` inside `RestrictedClassesUnitTest::enhanceGroups()` is not necessary, and it was leading to this method being called twice. PHPUnit already calls it as it used the `@before` that. I found this in the context of the work to prepare this codebase for PHPCS 4.0 as `parent::setUpPrerequisites()` was removed from the sniff test framework in 4.0. Originally, `RestrictedClassesUnitTest::enhanceGroups()` was called `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 made sense to continue calling `setUp()` (which was later renamed to `setUpPrerequisites()`): WordPress@00b895c.
1 parent f62f272 commit b783a4e

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)