PhpdocTagCasingFixerTest.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. final class PhpdocTagCasingFixerTest extends AbstractFixerTestCase
  20. {
  21. /**
  22. * @param array<string, mixed> $config
  23. *
  24. * @dataProvider provideFixCases
  25. */
  26. public function testFix(string $expected, ?string $input = null, array $config = []): void
  27. {
  28. $this->fixer->configure($config);
  29. $this->doTest($expected, $input);
  30. }
  31. public static function provideFixCases(): iterable
  32. {
  33. yield [
  34. '<?php /** @inheritDoc */',
  35. '<?php /** @inheritdoc */',
  36. ];
  37. yield [
  38. '<?php /** @inheritDoc */',
  39. '<?php /** @inheritdoc */',
  40. ['tags' => ['inheritDoc']],
  41. ];
  42. yield [
  43. '<?php /** @inheritdoc */',
  44. '<?php /** @inheritDoc */',
  45. ['tags' => ['inheritdoc']],
  46. ];
  47. yield [
  48. '<?php /** {@inheritDoc} */',
  49. '<?php /** {@inheritdoc} */',
  50. ];
  51. yield [
  52. '<?php /** {@inheritDoc} */',
  53. '<?php /** {@inheritdoc} */',
  54. ['tags' => ['inheritDoc']],
  55. ];
  56. yield [
  57. '<?php /** {@inheritdoc} */',
  58. '<?php /** {@inheritDoc} */',
  59. ['tags' => ['inheritdoc']],
  60. ];
  61. }
  62. }