NativeFunctionTypeDeclarationCasingFixerTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of PHP CS Fixer.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  8. *
  9. * This source file is subject to the MIT license that is bundled
  10. * with this source code in the file LICENSE.
  11. */
  12. namespace PhpCsFixer\Tests\Fixer\Casing;
  13. use PhpCsFixer\Fixer\DeprecatedFixerInterface;
  14. use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
  15. /**
  16. * @internal
  17. *
  18. * @covers \PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer
  19. *
  20. * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer>
  21. */
  22. final class NativeFunctionTypeDeclarationCasingFixerTest extends AbstractFixerTestCase
  23. {
  24. public function testFunctionIsDeprecatedProperly(): void
  25. {
  26. $fixer = $this->fixer;
  27. self::assertInstanceOf(DeprecatedFixerInterface::class, $fixer);
  28. self::assertSame(
  29. ['native_type_declaration_casing'],
  30. $fixer->getSuccessorsNames(),
  31. );
  32. }
  33. /**
  34. * @dataProvider provideFixCases
  35. */
  36. public function testFix(string $expected, ?string $input = null): void
  37. {
  38. $this->doTest($expected, $input);
  39. }
  40. /**
  41. * @return iterable<array{string, null|string}>
  42. */
  43. public static function provideFixCases(): iterable
  44. {
  45. yield from NativeTypeDeclarationCasingFixerTest::provideFixCases();
  46. }
  47. }