PHPUnit_Framework_Constraint_GreaterThan::evaluate PHP Method

evaluate() public method

Evaluates the constraint for parameter $other. Returns TRUE if the constraint is met, FALSE otherwise.
public evaluate ( mixed $other ) : boolean
$other mixed Value or object to evaluate.
return boolean
    public function evaluate($other)
    {
        return $this->value < $other;
    }

Usage Example

Example #1
0
 public function testConstraintGreaterThan()
 {
     $constraint = new PHPUnit_Framework_Constraint_GreaterThan(1);
     $this->assertFalse($constraint->evaluate(0));
     $this->assertTrue($constraint->evaluate(2));
     $this->assertEquals('is greater than <integer:1>', $constraint->toString());
     try {
         $constraint->fail(0, '');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("Failed asserting that <integer:0> is greater than <integer:1>.", $e->getDescription());
         return;
     }
     $this->fail();
 }
PHPUnit_Framework_Constraint_GreaterThan