PhpdocTagCasingFixerTest.php 1.8 KB

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