greaterThanOrEqual() public static method

Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_GreaterThan matcher object.
public static greaterThanOrEqual ( mixed $value ) : PHPUnit_Framework_Constraint_Or
$value mixed
return PHPUnit_Framework_Constraint_Or
コード例 #1
0
 /**
  * @covers PHPUnit_Framework_Constraint_IsEqual
  * @covers PHPUnit_Framework_Constraint_GreaterThan
  * @covers PHPUnit_Framework_Constraint_Or
  * @covers PHPUnit_Framework_Constraint_Not
  * @covers PHPUnit_Framework_Assert::greaterThanOrEqual
  * @covers PHPUnit_Framework_Assert::logicalNot
  */
 public function testConstraintNotGreaterThanOrEqual2()
 {
     $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::greaterThanOrEqual(1));
     try {
         $constraint->fail(1, 'custom message', TRUE);
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that <integer:1> not( is equal to <integer:1> or is greater than <integer:1> ).", $e->getDescription());
         return;
     }
     $this->fail();
 }
コード例 #2
0
ファイル: Functions.php プロジェクト: delkyd/sugarcrm_dev
/**
 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
 * a PHPUnit_Framework_Constraint_IsEqual and a
 * PHPUnit_Framework_Constraint_GreaterThan matcher object.
 *
 * @param  mixed $value
 * @return PHPUnit_Framework_Constraint_Or
 * @since  Method available since Release 3.1.0
 */
function greaterThanOrEqual($value)
{
    return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
}
コード例 #3
0
    /**
     * @covers PHPUnit_Framework_Constraint_IsEqual
     * @covers PHPUnit_Framework_Constraint_GreaterThan
     * @covers PHPUnit_Framework_Constraint_Or
     * @covers PHPUnit_Framework_Constraint_Not
     * @covers PHPUnit_Framework_Assert::greaterThanOrEqual
     * @covers PHPUnit_Framework_Assert::logicalNot
     * @covers PHPUnit_Framework_TestFailure::exceptionToString
     */
    public function testConstraintNotGreaterThanOrEqual2()
    {
        $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::greaterThanOrEqual(1));
        try {
            $constraint->evaluate(1, 'custom message');
        } catch (PHPUnit_Framework_ExpectationFailedException $e) {
            $this->assertEquals(<<<EOF
custom message
Failed asserting that not( 1 is equal to 1 or is greater than 1 ).

EOF
, PHPUnit_Framework_TestFailure::exceptionToString($e));
            return;
        }
        $this->fail();
    }
コード例 #4
0
 public function testHasHeadersCanSucceedWithConstraint()
 {
     $request = new Request('GET', '/', ['x-foo' => 14, 'content-type' => 'text/plain']);
     assertThat($request, hasHeaders(['X-Foo' => Assert::greaterThanOrEqual(10), 'Content-Type' => 'text/plain']));
 }
コード例 #5
0
 /**
  * @expectedException \PHPUnit_Framework_AssertionFailedError
  */
 public function testStatusCanBeAnyConstraintAndCanFail()
 {
     $response = new Response(234);
     $constraint = new HasStatusConstraint(Assert::greaterThanOrEqual(300));
     $constraint->evaluate($response);
 }
コード例 #6
0
 public static function isServerError()
 {
     return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(500), Assert::lessThan(600)));
 }
コード例 #7
0
 /**
  * @expectedException \PHPUnit_Framework_AssertionFailedError
  */
 public function testHasHeaderCanFailWithConstraint()
 {
     $request = new Request('GET', '/', ['x-foo' => 4]);
     $this->assertMessageHasHeader($request, 'X-Foo', Assert::greaterThanOrEqual(10));
 }