PhpdocTagCasingFixerTest.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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\Phpdoc;
  13. use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
  14. /**
  15. * @internal
  16. *
  17. * @covers \PhpCsFixer\Fixer\Phpdoc\PhpdocTagCasingFixer
  18. *
  19. * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Phpdoc\PhpdocTagCasingFixer>
  20. *
  21. * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\Phpdoc\PhpdocTagCasingFixer
  22. */
  23. final class PhpdocTagCasingFixerTest extends AbstractFixerTestCase
  24. {
  25. /**
  26. * @param _AutogeneratedInputConfiguration $config
  27. *
  28. * @dataProvider provideFixCases
  29. */
  30. public function testFix(string $expected, ?string $input = null, array $config = []): void
  31. {
  32. $this->fixer->configure($config);
  33. $this->doTest($expected, $input);
  34. }
  35. public static function provideFixCases(): iterable
  36. {
  37. yield [
  38. '<?php /** @inheritDoc */',
  39. '<?php /** @inheritdoc */',
  40. ];
  41. yield [
  42. '<?php /** @inheritDoc */',
  43. '<?php /** @inheritdoc */',
  44. ['tags' => ['inheritDoc']],
  45. ];
  46. yield [
  47. '<?php /** @inheritdoc */',
  48. '<?php /** @inheritDoc */',
  49. ['tags' => ['inheritdoc']],
  50. ];
  51. yield [
  52. '<?php /** {@inheritDoc} */',
  53. '<?php /** {@inheritdoc} */',
  54. ];
  55. yield [
  56. '<?php /** {@inheritDoc} */',
  57. '<?php /** {@inheritdoc} */',
  58. ['tags' => ['inheritDoc']],
  59. ];
  60. yield [
  61. '<?php /** {@inheritdoc} */',
  62. '<?php /** {@inheritDoc} */',
  63. ['tags' => ['inheritdoc']],
  64. ];
  65. }
  66. }