示例#1
0
 /**
  * Applies match results to other template variables.
  *
  * @param  TemplateInterface $template
  * @return array
  */
 protected function getTemplateVars(TemplateInterface $template)
 {
     $vars = ['expected' => $this->match->getExpected(), 'actual' => $this->match->getActual()];
     if ($tplVars = $template->getTemplateVars()) {
         $vars = array_merge($vars, $tplVars);
     }
     return $vars;
 }
示例#2
0
 /**
  * {@inheritdoc}
  *
  * Throws an exception containing the formatted message.
  *
  * @param  Match             $match
  * @param  TemplateInterface $template
  * @param  string            $message
  * @return void
  * @throws Exception
  */
 public function respond(Match $match, TemplateInterface $template, $message = '')
 {
     if ($match->isMatch()) {
         return;
     }
     $this->formatter->setMatch($match);
     $message = $message ? $message : $this->formatter->getMessage($template);
     throw new AssertionException($message);
 }