本文整理匯總了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());
}