LowercaseKeywordsFixerTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 LowercaseKeywordsFixerTest extends AbstractFixerTestBase
  16. {
  17. /**
  18. * @dataProvider provideExamples
  19. */
  20. public function testFix($expected, $input = null)
  21. {
  22. $this->makeTest($expected, $input);
  23. }
  24. public function provideExamples()
  25. {
  26. return array(
  27. array('<?php $x = (1 and 2);', '<?php $x = (1 AND 2);'),
  28. array('<?php foreach(array(1, 2, 3) as $val) {}', '<?php FOREACH(array(1, 2, 3) AS $val) {}'),
  29. array('<?php echo "GOOD AS NEW";'),
  30. );
  31. }
  32. /**
  33. * @requires PHP 5.4
  34. */
  35. public function testHaltCompiler()
  36. {
  37. $this->makeTest('<?php __HALT_COMPILER();');
  38. }
  39. }