Browse Source

DX: cleanup `PhpUnitStrictFixerTest` (#7938)

Kuba Werłos 11 months ago
parent
commit
f3aa277bcc

+ 1 - 1
phpstan.dist.neon

@@ -21,6 +21,6 @@ parameters:
         -
             message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
             path: tests
-            count: 1020
+            count: 1019
     tipsOfTheDay: false
     tmpDir: dev-tools/phpstan/cache

+ 2 - 15
tests/Fixer/PhpUnit/PhpUnitStrictFixerTest.php

@@ -104,21 +104,8 @@ final class PhpUnitStrictFixerTest extends AbstractFixerTestCase
                 self::generateTest("self::{$methodBefore}(1, \$a, '', );"),
             ];
         }
-    }
-
-    /**
-     * Only method calls with 2 or 3 arguments should be fixed.
-     *
-     * @dataProvider provideNoFixWithWrongNumberOfArgumentsCases
-     */
-    public function testNoFixWithWrongNumberOfArguments(string $expected): void
-    {
-        $this->fixer->configure(['assertions' => array_keys(self::getMethodsMap())]);
-        $this->doTest($expected);
-    }
 
-    public static function provideNoFixWithWrongNumberOfArgumentsCases(): iterable
-    {
+        // Only method calls with 2 or 3 arguments should be fixed.
         foreach (self::getMethodsMap() as $candidate => $fix) {
             yield sprintf('do not change call to "%s" without arguments.', $candidate) => [
                 self::generateTest(sprintf('$this->%s();', $candidate)),
@@ -138,7 +125,7 @@ final class PhpUnitStrictFixerTest extends AbstractFixerTestCase
         }
     }
 
-    public function testInvalidConfig(): void
+    public function testInvalidConfiguration(): void
     {
         $this->expectException(InvalidFixerConfigurationException::class);
         $this->expectExceptionMessageMatches('/^\[php_unit_strict\] Invalid configuration: The option "assertions" .*\.$/');

+ 0 - 2
tests/Test/AbstractFixerTestCase.php

@@ -82,7 +82,6 @@ use PhpCsFixer\Tests\Fixer\PhpTag\NoClosingTagFixerTest;
 use PhpCsFixer\Tests\Fixer\PhpUnit\PhpUnitConstructFixerTest;
 use PhpCsFixer\Tests\Fixer\PhpUnit\PhpUnitDedicateAssertFixerTest;
 use PhpCsFixer\Tests\Fixer\PhpUnit\PhpUnitMethodCasingFixerTest;
-use PhpCsFixer\Tests\Fixer\PhpUnit\PhpUnitStrictFixerTest;
 use PhpCsFixer\Tests\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixerTest;
 use PhpCsFixer\Tests\Fixer\ReturnNotation\ReturnAssignmentFixerTest;
 use PhpCsFixer\Tests\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixerTest;
@@ -503,7 +502,6 @@ abstract class AbstractFixerTestCase extends TestCase
             PhpUnitConstructFixerTest::class,
             PhpUnitDedicateAssertFixerTest::class,
             PhpUnitMethodCasingFixerTest::class,
-            PhpUnitStrictFixerTest::class,
             PhpUnitTestCaseStaticMethodCallsFixerTest::class,
             ReturnAssignmentFixerTest::class,
             ReturnTypeDeclarationFixerTest::class,