ClearCommandTest.php 702 B

12345678910111213141516171819202122232425262728293031
  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\Command;
  11. use Psy\Command\ClearCommand;
  12. use Symfony\Component\Console\Tester\CommandTester;
  13. /**
  14. * @group isolation-fail
  15. */
  16. class ClearCommandTest extends \Psy\Test\TestCase
  17. {
  18. public function testExecute()
  19. {
  20. $command = new ClearCommand();
  21. $tester = new CommandTester($command);
  22. $tester->execute([]);
  23. $clear = \sprintf('%c[2J%c[0;0f', 27, 27);
  24. $this->assertStringContainsString($clear, $tester->getDisplay());
  25. }
  26. }