You are here

public function AbstractProcessTest::testStatus 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::testStatus()

File

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

Class

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

Namespace

Symfony\Component\Process\Tests

Code

public function testStatus() {
  $process = $this
    ->getProcess(self::$phpBin . ' -r "usleep(500000);"');
  $this
    ->assertFalse($process
    ->isRunning());
  $this
    ->assertFalse($process
    ->isStarted());
  $this
    ->assertFalse($process
    ->isTerminated());
  $this
    ->assertSame(Process::STATUS_READY, $process
    ->getStatus());
  $process
    ->start();
  $this
    ->assertTrue($process
    ->isRunning());
  $this
    ->assertTrue($process
    ->isStarted());
  $this
    ->assertFalse($process
    ->isTerminated());
  $this
    ->assertSame(Process::STATUS_STARTED, $process
    ->getStatus());
  $process
    ->wait();
  $this
    ->assertFalse($process
    ->isRunning());
  $this
    ->assertTrue($process
    ->isStarted());
  $this
    ->assertTrue($process
    ->isTerminated());
  $this
    ->assertSame(Process::STATUS_TERMINATED, $process
    ->getStatus());
}