/**
  * Return a default TemplateInterface if none was set.
  *
  * @return TemplateInterface
  */
 public function getDefaultTemplate()
 {
     $expectedMethods = implode(', ', $this->expected);
     $actualMethods = implode(', ', $this->actual);
     $template = new ArrayTemplate(['default' => 'Expected response to allow {{expected_methods}}, got {{actual_methods}}', 'negated' => 'Expected response not to allow {{expected_methods}}']);
     return $template->setTemplateVars(['expected_methods' => $expectedMethods, 'actual_methods' => $actualMethods]);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  *
  * @return TemplateInterface
  */
 public function getDefaultTemplate()
 {
     $subject = 'key';
     if (count($this->expected) > 1) {
         $subject = 'keys';
     }
     $template = new ArrayTemplate(['default' => "Expected {{actual}} to {$this->verb} {$subject} {{keys}}", 'negated' => "Expected {{actual}} to not {$this->verb} {$subject} {{keys}}"]);
     return $template->setTemplateVars(['keys' => $this->getKeyString()]);
 }
 /**
  * Return a default TemplateInterface if none was set.
  *
  * @return TemplateInterface
  */
 public function getDefaultTemplate()
 {
     $template = new ArrayTemplate(['default' => 'Expected status code {{expected}}, got {{actual_status}}', 'negated' => 'Expected status code to not be {{expected}}']);
     return $template->setTemplateVars(['actual_status' => $this->actualStatusCode]);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  *
  * @return TemplateInterface
  */
 public function getDefaultTemplate()
 {
     $template = new ArrayTemplate(['default' => 'Expected {{actual}} to have a length of {{expected}} but got {{count}}', 'negated' => 'Expected {{actual}} to not have a length of {{expected}}']);
     return $template->setTemplateVars(['count' => $this->count]);
 }
예제 #5
0
 /**
  * {@inheritdoc}
  *
  * @return TemplateInterface
  */
 public function getDefaultTemplate()
 {
     list($default, $negated) = $this->getTemplateStrings();
     $template = new ArrayTemplate(['default' => $default, 'negated' => $negated]);
     return $template->setTemplateVars(['key' => $this->getKey(), 'value' => $this->getValue(), 'actualValue' => $this->getActualValue()]);
 }