本文整理汇总了PHP中EqualExpectation类的典型用法代码示例。如果您正苦于以下问题:PHP EqualExpectation类的具体用法?PHP EqualExpectation怎么用?PHP EqualExpectation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EqualExpectation类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testEqualComparisonOfMocksDoesNotCrash
function testEqualComparisonOfMocksDoesNotCrash()
{
$expectation = new EqualExpectation(new MockDummy());
$this->assertTrue($expectation->test(new MockDummy(), true));
}
示例2: testHashWithOutOfOrderKeysShouldStillMatch
function testHashWithOutOfOrderKeysShouldStillMatch()
{
$any_order = new EqualExpectation(array('a' => 1, 'b' => 2));
$this->assertTrue($any_order->test(array('b' => 2, 'a' => 1)));
}
示例3: testMessage
function testMessage($compare)
{
$message = '';
foreach ($this->expected as $key => $value) {
if (isset($compare[$key])) {
$e = new EqualExpectation($value);
if ($e->test($compare[$key])) {
$message .= $key . ' ok.';
} else {
$message .= $key . ' => ' . $e->overlayMessage($compare[$key], $this->_dumper);
}
} else {
return $key . ' not found';
}
}
return $message;
}
示例4: test
/**
* Tests the expectation. True if it differs from the
* held value.
* @param mixed $compare Comparison value.
* @return boolean True if correct.
* @access public
*/
function test($compare)
{
return !parent::test($compare);
}
示例5: test
function test($compare)
{
return parent::test(str_replace('\\', '/', $compare));
}
示例6:
/**
* Sets the value to compare against.
* @param mixed $value Test value to match.
* @param string $message Customised message on failure.
* @access public
*/
function __construct($value, $message = '%s')
{
parent::__construct($value, $message);
}
示例7: test
public function test($compare)
{
return parent::test(str_replace("\\", '/', $compare));
}