You are here

public function AbstractProcessTest::testSetInputWhileRunningThrowsAnException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Tests/AbstractProcessTest.php \Symfony\Component\Process\Tests\AbstractProcessTest::testSetInputWhileRunningThrowsAnException()

File

vendor/symfony/process/Tests/AbstractProcessTest.php, line 195

Class

AbstractProcessTest
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testSetInputWhileRunningThrowsAnException() {
  $process = $this
    ->getProcess(self::$phpBin . ' -r "usleep(500000);"');
  $process
    ->start();
  try {
    $process
      ->setInput('foobar');
    $process
      ->stop();
    $this
      ->fail('A LogicException should have been raised.');
  } catch (LogicException $e) {
    $this
      ->assertEquals('Input can not be set while the process is running.', $e
      ->getMessage());
  }
  $process
    ->stop();
}