Skip to content

Commit

Permalink
[Process] Fix Process test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
romainneutron committed Mar 31, 2014
1 parent 7cc8e7a commit a42fbd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/Symfony/Component/Process/Tests/AbstractProcessTest.php
Expand Up @@ -313,10 +313,15 @@ public function testPTYCommand()

public function testMustRun()
{
$process = $this->getProcess('echo "foo"');
$process = $this->getProcess('echo foo');

$this->assertSame($process, $process->mustRun());
$this->assertEquals("foo\n", $process->getOutput());
$this->assertEquals("foo".PHP_EOL, $process->getOutput());
}

public function testSuccessfulMustRunHasCorrectExitCode()
{
$process = $this->getProcess('echo foo')->mustRun();
$this->assertEquals(0, $process->getExitCode());
}

Expand Down Expand Up @@ -612,7 +617,7 @@ public function testCheckTimeoutOnStartedProcess()
*/
public function testIdleTimeout()
{
$process = $this->getProcess('sleep 3');
$process = $this->getProcess('php -r "sleep(3);"');
$process->setTimeout(10);
$process->setIdleTimeout(0.5);

Expand All @@ -632,7 +637,7 @@ public function testIdleTimeout()
*/
public function testIdleTimeoutNotExceededWhenOutputIsSent()
{
$process = $this->getProcess('echo "foo" && sleep 1 && echo "foo" && sleep 1 && echo "foo" && sleep 1');
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); "');
$process->setTimeout(2);
$process->setIdleTimeout(1.5);

Expand Down
Expand Up @@ -51,11 +51,11 @@ public function testExitCodeCommandFailed()

/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
* @expectedExceptionMessage his PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.
* @expectedExceptionMessage This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.
*/
public function testMustRun()
public function testSuccessfulMustRunHasCorrectExitCode()
{
parent::testMustRun();
parent::testSuccessfulMustRunHasCorrectExitCode();
}

/**
Expand Down

0 comments on commit a42fbd7

Please sign in to comment.