diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 245163ae67bf..6037c844e423 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -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()); } diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 03b621551d0b..18b0220154ed 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -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. *