本文整理汇总了PHP中PHPUnit_Framework_Assert::lessThan方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::lessThan方法的具体用法?PHP PHPUnit_Framework_Assert::lessThan怎么用?PHP PHPUnit_Framework_Assert::lessThan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::lessThan方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lessThan
/**
* Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
*
* @param mixed $value
* @return PHPUnit_Framework_Constraint_LessThan
* @since Method available since Release 3.0.0
*/
function lessThan($value)
{
return PHPUnit_Framework_Assert::lessThan($value);
}
示例2: testConstraintNotLessThan2
/**
* @covers PHPUnit_Framework_Constraint_LessThan
* @covers PHPUnit_Framework_Constraint_Not
* @covers PHPUnit_Framework_Assert::lessThan
* @covers PHPUnit_Framework_Assert::logicalNot
*/
public function testConstraintNotLessThan2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::lessThan(1));
try {
$constraint->fail(1, 'custom message', TRUE);
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals("custom message\nFailed asserting that <integer:1> is not less than <integer:1>.", $e->getDescription());
return;
}
$this->fail();
}
示例3: testStatusCanBeAnyConstraint
public function testStatusCanBeAnyConstraint()
{
$response = new Response(234);
$constraint = new HasStatusConstraint(Assert::lessThan(300));
$constraint->evaluate($response);
}
示例4: testConstraintNotLessThan2
/**
* @covers PHPUnit_Framework_Constraint_LessThan
* @covers PHPUnit_Framework_Constraint_Not
* @covers PHPUnit_Framework_Assert::lessThan
* @covers PHPUnit_Framework_Assert::logicalNot
* @covers PHPUnit_Framework_TestFailure::exceptionToString
*/
public function testConstraintNotLessThan2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::lessThan(1));
try {
$constraint->evaluate(0, 'custom message');
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals(<<<EOF
custom message
Failed asserting that 0 is not less than 1.
EOF
, PHPUnit_Framework_TestFailure::exceptionToString($e));
return;
}
$this->fail();
}
示例5: isServerError
public static function isServerError()
{
return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(500), Assert::lessThan(600)));
}