MagicConstantsPassTest.php 857 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. * This file is part of Psy Shell.
  4. *
  5. * (c) 2012-2023 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. /**
  13. * @group isolation-fail
  14. */
  15. class MagicConstantsPassTest extends CodeCleanerTestCase
  16. {
  17. /**
  18. * @before
  19. */
  20. public function getReady()
  21. {
  22. $this->setPass(new MagicConstantsPass());
  23. }
  24. /**
  25. * @dataProvider magicConstants
  26. */
  27. public function testProcess($from, $to)
  28. {
  29. $this->assertProcessesAs($from, $to);
  30. }
  31. public function magicConstants()
  32. {
  33. return [
  34. ['__DIR__;', 'getcwd();'],
  35. ['__FILE__;', "'';"],
  36. ['___FILE___;', '___FILE___;'],
  37. ];
  38. }
  39. }