PhpdocNoAccessFixerTest.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. * @author Graham Campbell <hello@gjcampbell.co.uk>
  16. *
  17. * @internal
  18. *
  19. * @covers \PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer
  20. */
  21. final class PhpdocNoAccessFixerTest extends AbstractFixerTestCase
  22. {
  23. public function testFixAccess(): void
  24. {
  25. $expected = <<<'EOF'
  26. <?php
  27. /**
  28. */
  29. EOF;
  30. $input = <<<'EOF'
  31. <?php
  32. /**
  33. * @access public
  34. */
  35. EOF;
  36. $this->doTest($expected, $input);
  37. }
  38. public function testFixMany(): void
  39. {
  40. $expected = <<<'EOF'
  41. <?php
  42. /**
  43. * Hello!
  44. * @notaccess bar
  45. */
  46. EOF;
  47. $input = <<<'EOF'
  48. <?php
  49. /**
  50. * Hello!
  51. * @access private
  52. * @notaccess bar
  53. * @access foo
  54. */
  55. EOF;
  56. $this->doTest($expected, $input);
  57. }
  58. public function testDoNothing(): void
  59. {
  60. $expected = <<<'EOF'
  61. <?php
  62. /**
  63. * @var access
  64. */
  65. EOF;
  66. $this->doTest($expected);
  67. }
  68. }