LineAfterNamespaceFixerTest.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /*
  3. * This file is part of the PHP CS utility.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Symfony\CS\Tests\Fixer\PSR2;
  11. use Symfony\CS\Tests\Fixer\AbstractFixerTestBase;
  12. /**
  13. * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
  14. */
  15. class LineAfterNamespaceFixerTest extends AbstractFixerTestBase
  16. {
  17. /**
  18. * @dataProvider provideCases
  19. */
  20. public function testFix($expected, $input = null)
  21. {
  22. $this->makeTest($expected, $input);
  23. }
  24. public function provideCases()
  25. {
  26. return array(
  27. array(
  28. '<?php
  29. namespace A\B;
  30. class C {}
  31. ',
  32. '<?php
  33. namespace A\B;
  34. class C {}
  35. ',
  36. ),
  37. array(
  38. '<?php
  39. namespace A\B;
  40. class C {}
  41. ',
  42. ),
  43. array(
  44. '<?php
  45. namespace A\B;
  46. class C {}
  47. ',
  48. '<?php
  49. namespace A\B;
  50. class C {}
  51. ',
  52. ),
  53. array(
  54. '<?php
  55. namespace A\B;
  56. class C {}
  57. ',
  58. '<?php
  59. namespace A\B; class C {}
  60. ',
  61. ),
  62. array(
  63. '<?php
  64. namespace A\B;
  65. class C {}
  66. ',
  67. '<?php
  68. namespace A\B;class C {}
  69. ',
  70. ),
  71. array(
  72. '<?php
  73. namespace A\B {
  74. class C {
  75. public $foo;
  76. private $bar;
  77. }
  78. }
  79. ',
  80. ),
  81. array(
  82. "<?php\rnamespace A\B;
  83. class C {}\r",
  84. "<?php\rnamespace A\B;\r\r\r\r\r\rclass C {}\r",
  85. ),
  86. );
  87. }
  88. }