/** * @return array * * @throws \LogicException */ private function getRunStats() { $output = $this->applicationTester->getDisplay(); $matches = array(); $regexp = '/.*' . '(?P<examples>\\d+) examples?.*' . '\\(' . '(?:(?P<passed>\\d+) passed)?.*?' . '(?:(?P<skipped>\\d+) skipped)?.*?' . '(?:(?P<broken>\\d+) broken)?.*?' . '(?:(?P<failed>\\d+) failed)?' . '\\)' . '.*/sm'; if (!preg_match($regexp, $output, $matches)) { throw new \LogicException(sprintf('Could not determine the run result based on the output: %s', $output)); } return array('examples' => (int) $matches['examples'], 'passed' => isset($matches['passed']) ? (int) $matches['passed'] : 0, 'skipped' => isset($matches['skipped']) ? (int) $matches['skipped'] : 0, 'broken' => isset($matches['broken']) ? (int) $matches['broken'] : 0, 'failed' => isset($matches['failed']) ? (int) $matches['failed'] : 0); }
/** * @Then the exit code should be :code */ public function theExitCodeShouldBe($code) { expect($this->applicationTester->getStatusCode())->toBe((int) $code); }