Skip to content

Commit

Permalink
[Process] added a Process:isSucessful() method
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 16, 2010
1 parent 61f1866 commit 7734f44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/BrowserKit/Client.php
Expand Up @@ -235,7 +235,7 @@ protected function doRequestInProcess($request)
$process = new PhpProcess($this->getScript($request));
$process->run();

if ($process->getExitCode() > 0) {
if (!$process->isSuccessful()) {
throw new \RuntimeException($process->getErrorOutput());
}

Expand Down
10 changes: 10 additions & 0 deletions src/Symfony/Component/Process/Process.php
Expand Up @@ -194,6 +194,16 @@ public function getExitCode()
return $this->exitcode;
}

/**
* Checks if the process ended successfully.
*
* @return Boolean true if the process ended successfully, false otherwise
*/
public function isSuccessful()
{
return 0 == $this->exitcode;
}

/**
* Returns true if the child process has been terminated by an uncaught signal.
*
Expand Down

0 comments on commit 7734f44

Please sign in to comment.