MagicConstantsPassTest.php 810 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of Psy Shell.
  4. *
  5. * (c) 2012-2017 Justin Hileman
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Psy\Test\CodeCleaner;
  11. use Psy\CodeCleaner\MagicConstantsPass;
  12. class MagicConstantsPassTest extends CodeCleanerTestCase
  13. {
  14. public function setUp()
  15. {
  16. $this->setPass(new MagicConstantsPass());
  17. }
  18. /**
  19. * @dataProvider magicConstants
  20. */
  21. public function testProcess($from, $to)
  22. {
  23. $this->assertProcessesAs($from, $to);
  24. }
  25. public function magicConstants()
  26. {
  27. return array(
  28. array('__DIR__;', 'getcwd();'),
  29. array('__FILE__;', "'';"),
  30. array('___FILE___;', '___FILE___;'),
  31. );
  32. }
  33. }