public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('a value ')->appendText($this->_comparison($this->_minCompare));
     if ($this->_minCompare != $this->_maxCompare) {
         $description->appendText(' or ')->appendText($this->_comparison($this->_maxCompare));
     }
     $description->appendText(' ')->appendValue($this->_value);
 }
示例#2
0
 public function describeMismatch($item, Hamcrest_Description $description)
 {
     if ($item === null) {
         $description->appendText('was null');
     } else {
         $description->appendText('was ')->appendText(self::getTypeDescription(strtolower(gettype($item))))->appendText(' ')->appendValue($item);
     }
 }
示例#3
0
 /**
  * Generates a description of the object.  The description may be part
  * of a description of a larger object of which this is just a component,
  * so it should be worded appropriately.
  *
  * @param Hamcrest_Description $description
  *   The description to be built or appended to.
  */
 public function describeTo(\Hamcrest_Description $description)
 {
     if (empty($this->description)) {
         foreach ($this->expected as $expected) {
             $description->appendValue($expected);
         }
     } else {
         $description->appendText($this->description);
     }
 }
示例#4
0
 public function describeTo(Hamcrest_Description $description)
 {
     $textStart = 0;
     while (preg_match(self::ARG_PATTERN, $this->_descriptionTemplate, $matches, PREG_OFFSET_CAPTURE, $textStart)) {
         $text = $matches[0][0];
         $index = $matches[1][0];
         $offset = $matches[0][1];
         $description->appendText(substr($this->_descriptionTemplate, $textStart, $offset - $textStart));
         $description->appendValue($this->_values[$index]);
         $textStart = $offset + strlen($text);
     }
     if ($textStart < strlen($this->_descriptionTemplate)) {
         $description->appendText(substr($this->_descriptionTemplate, $textStart));
     }
 }
示例#5
0
 public function describeMismatch($item, Hamcrest_Description $description)
 {
     if (!$this->_not) {
         $description->appendText('was not set');
     } else {
         $property = $this->_property;
         if (is_array($item)) {
             $value = $item[$property];
         } elseif (is_object($item)) {
             $value = $item->{$property};
         } elseif (is_string($item)) {
             $value = $item::${$property};
         }
         parent::describeMismatch($value, $description);
     }
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('a collection containing ')->appendDescriptionOf($this->_elementMatcher);
 }
示例#7
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('every item is ')->appendDescriptionOf($this->_matcher);
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('array with key ')->appendDescriptionOf($this->_keyMatcher);
 }
示例#9
0
 public function describeMismatch($item, Hamcrest_Description $description)
 {
     $description->appendText('was ')->appendValue($item);
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendDescriptionOf($this->_matcher);
 }
 public function describeToWithOperator(Hamcrest_Description $description, $operator)
 {
     $description->appendList('(', ' ' . $operator . ' ', ')', $this->_matchers);
 }
示例#12
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendList($this->descriptionStart(), $this->descriptionSeparator(), $this->descriptionEnd(), $this->_elementMatchers);
 }
示例#13
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText($this->_empty ? 'an empty string' : 'a non-empty string');
 }
 public function describeTo(\Hamcrest_Description $description)
 {
     $description->appendText('Apache_Solr_Document with properties ' . var_export($this->properties, true));
 }
示例#15
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('a string ')->appendText($this->relationship())->appendText(' ')->appendValue($this->_substring);
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText($this->_empty ? 'an empty traversable' : 'a non-empty traversable');
 }
示例#17
0
文件: False.php 项目: rafeca/Spec-PHP
 public function describeTo(\Hamcrest_Description $description)
 {
     $description->appendText('boolean and false');
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('equalToIgnoringCase(')->appendValue($this->_string)->appendText(')');
 }
示例#19
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendList('(', ' and ', ')', $this->_matchers);
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('a string containing ')->appendValueList('', ', ', '', $this->_substrings)->appendText(' in order');
 }
示例#21
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendValue($this->_item);
 }
示例#22
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('null');
 }
示例#23
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('SOME DESCRIPTION');
 }
示例#24
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('an instance of ')->appendText($this->_theClass);
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText($this->_text);
 }
示例#26
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('a numeric value within ')->appendValue($this->_delta)->appendText(' of ')->appendValue($this->_value);
 }
示例#27
0
 public function describeTo(\Hamcrest_Description $description)
 {
     $description->appendText('empty');
 }
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendList('[', ', ', ']', $this->_elementMatchers);
 }
示例#29
0
 public function describeTo(Hamcrest_Description $description)
 {
     $description->appendText('sameInstance(')->appendValue($this->_object)->appendText(')');
 }
示例#30
0
 public final function describeTo(Hamcrest_Description $description)
 {
     $description->appendText($this->_featureDescription)->appendText(' ')->appendDescriptionOf($this->_subMatcher);
 }