toString() public method

Returns a string representation of the constraint.
public toString ( ) : string
return string
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();
 }