本文整理汇总了PHP中Hamcrest\Description::appendValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Description::appendValue方法的具体用法?PHP Description::appendValue怎么用?PHP Description::appendValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hamcrest\Description
的用法示例。
在下文中一共展示了Description::appendValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: describeMismatchSafely
protected function describeMismatchSafely($array, Description $mismatchDescription)
{
//Not using appendValueList() so that keys can be shown
$mismatchDescription->appendText('array was ')->appendText('[');
$loop = false;
foreach ($array as $key => $value) {
if ($loop) {
$mismatchDescription->appendText(', ');
}
$mismatchDescription->appendValue($key)->appendText(' => ')->appendValue($value);
$loop = true;
}
$mismatchDescription->appendText(']');
}
示例2: describeTo
public function describeTo(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));
}
}
示例3: describeMismatchSafely
protected function describeMismatchSafely($item, Description $mismatchDescription)
{
$mismatchDescription->appendValue($item)->appendText(' differed by ')->appendValue($this->_actualDelta($item));
}
示例4: describeTo
public function describeTo(Description $description)
{
$description->appendValue($this->_item);
}
示例5: describeMismatchSafely
protected function describeMismatchSafely($item, Description $mismatchDescription)
{
$mismatchDescription->appendValue($item)->appendText(' was ')->appendText($this->_comparison($this->_compare($this->_value, $item)))->appendText(' ')->appendValue($this->_value);
}
示例6: describeTo
public function describeTo(Description $description)
{
$description->appendValue($this->toString());
}