NoAliasLanguageConstructCallFixerTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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\Alias;
  12. use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
  13. /**
  14. * @author SpacePossum
  15. *
  16. * @internal
  17. *
  18. * @covers \PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer
  19. */
  20. final class NoAliasLanguageConstructCallFixerTest extends AbstractFixerTestCase
  21. {
  22. /**
  23. * @param string $expected
  24. * @param null|string $input
  25. *
  26. * @dataProvider provideFixCases
  27. */
  28. public function testFix($expected, $input = null)
  29. {
  30. $this->doTest($expected, $input);
  31. }
  32. public function provideFixCases()
  33. {
  34. return [
  35. [
  36. '<?php exit;',
  37. '<?php die;',
  38. ],
  39. [
  40. '<?php exit ("foo");',
  41. '<?php die ("foo");',
  42. ],
  43. [
  44. '<?php exit (1); EXIT(1);',
  45. '<?php DIE (1); EXIT(1);',
  46. ],
  47. [
  48. '<?php
  49. echo "die";
  50. // die;
  51. /* die(1); */
  52. echo $die;
  53. echo $die(1);
  54. echo $$die;
  55. ',
  56. ],
  57. ];
  58. }
  59. }