PhpUnitFqcnAnnotationFixerTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /*
  3. * This file is part of PHP CS Fixer.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. namespace PhpCsFixer\Tests\Fixer\PhpUnit;
  12. use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
  13. /**
  14. * @author Roland Franssen <franssen.roland@gmail.com>
  15. *
  16. * @internal
  17. *
  18. * @covers \PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer
  19. */
  20. final class PhpUnitFqcnAnnotationFixerTest extends AbstractFixerTestCase
  21. {
  22. public function testFix()
  23. {
  24. $expected = <<<'EOF'
  25. <?php
  26. /**
  27. * @ExpectedException Value
  28. * @expectedException \X
  29. * @expectedException
  30. * @expectedException \Exception
  31. * @expectedException \Some\Exception\ClassName
  32. * @expectedExceptionCode 123
  33. * @expectedExceptionMessage Foo bar
  34. *
  35. * @covers \Foo
  36. * @covers ::fooMethod
  37. * @coversDefaultClass \Bar
  38. * @uses \Baz
  39. */
  40. EOF;
  41. $input = <<<'EOF'
  42. <?php
  43. /**
  44. * @ExpectedException Value
  45. * @expectedException X
  46. * @expectedException
  47. * @expectedException \Exception
  48. * @expectedException Some\Exception\ClassName
  49. * @expectedExceptionCode 123
  50. * @expectedExceptionMessage Foo bar
  51. *
  52. * @covers Foo
  53. * @covers ::fooMethod
  54. * @coversDefaultClass Bar
  55. * @uses Baz
  56. */
  57. EOF;
  58. $this->doTest($expected, $input);
  59. }
  60. }