Просмотр исходного кода

DX: remove `PhpUnitNamespacedFixerTest::testClassIsFixed` (#7564)

Kuba Werłos 1 год назад
Родитель
Сommit
070901f0bc
2 измененных файлов с 1 добавлено и 29 удалено
  1. 1 1
      phpstan.dist.neon
  2. 0 28
      tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php

+ 1 - 1
phpstan.dist.neon

@@ -21,7 +21,7 @@ parameters:
         -
             message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
             path: tests
-            count: 1096
+            count: 1095
 
         -
             message: '#Call to static method .+ with .+ will always evaluate to true.$#'

+ 0 - 28
tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php

@@ -16,7 +16,6 @@ namespace PhpCsFixer\Tests\Fixer\PhpUnit;
 
 use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
 use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
-use PhpCsFixer\Tokenizer\Tokens;
 
 /**
  * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
@@ -281,33 +280,6 @@ final class PhpUnitNamespacedFixerTest extends AbstractFixerTestCase
         ];
     }
 
-    /**
-     * @dataProvider provideClassIsFixedCases
-     */
-    public function testClassIsFixed(string $class): void
-    {
-        $this->fixer->configure(['target' => PhpUnitTargetVersion::VERSION_NEWEST]);
-
-        Tokens::clearCache();
-        $tokens = Tokens::fromCode(sprintf('<?php new %s();', $class));
-
-        $this->fixer->fix(new \SplFileInfo(__FILE__), $tokens);
-
-        self::assertTrue($tokens->isChanged());
-        self::assertStringNotContainsString('_', $tokens->generateCode());
-    }
-
-    public static function provideClassIsFixedCases(): iterable
-    {
-        $classmap = require __DIR__.'/../../../vendor/composer/autoload_classmap.php';
-
-        foreach ($classmap as $class => $file) {
-            if (str_starts_with($class, 'PHPUnit_')) {
-                yield $file => [$class];
-            }
-        }
-    }
-
     /**
      * @dataProvider provideFix81Cases
      *