示例#1
0
 /**
  * @return array
  *
  * @throws \LogicException
  */
 private function getRunStats()
 {
     $output = $this->applicationTester->getDisplay();
     $matches = array();
     $regexp = '/.*' . '(?P<examples>\\d+) examples?.*' . '\\(' . '(?:(?P<passed>\\d+) passed)?.*?' . '(?:(?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, 'broken' => isset($matches['broken']) ? (int) $matches['broken'] : 0, 'failed' => isset($matches['failed']) ? (int) $matches['failed'] : 0);
 }
 /**
  * @Given /^I should see "([^"]*)"$/
  */
 public function iShouldSee($message)
 {
     expect($this->applicationTester->getDisplay())->toMatch('/' . preg_quote($message, '/') . '/sm');
 }