PhpProcessTest.php 673 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\Process\Tests;
  11. use Symfony\Component\Process\PhpProcess;
  12. class PhpProcessTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testNonBlockingWorks()
  15. {
  16. $expected = 'hello world!';
  17. $process = new PhpProcess(<<<PHP
  18. <?php echo '$expected';
  19. PHP
  20. );
  21. $process->start();
  22. $process->wait();
  23. $this->assertEquals($expected, $process->getOutput());
  24. }
  25. }