You are here

public function AbstractProcessTest::testIdleTimeout in Zircon Profile 8.0

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

File

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

Class

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

Namespace

Symfony\Component\Process\Tests

Code

public function testIdleTimeout() {
  $process = $this
    ->getProcess(self::$phpBin . ' -r "sleep(3);"');
  $process
    ->setTimeout(10);
  $process
    ->setIdleTimeout(0.5);
  try {
    $process
      ->run();
    $this
      ->fail('A timeout exception was expected.');
  } catch (ProcessTimedOutException $ex) {
    $this
      ->assertTrue($ex
      ->isIdleTimeout());
    $this
      ->assertFalse($ex
      ->isGeneralTimeout());
    $this
      ->assertEquals(0.5, $ex
      ->getExceededTimeout());
  }
}