toString() public method

Returns a string representation of the constraint.
public toString ( ) : string
return string
Esempio n. 1
0
 public function testConstraintArrayHasKey()
 {
     $constraint = new PHPUnit_Framework_Constraint_ArrayHasKey(0);
     $this->assertFalse($constraint->evaluate(array()));
     $this->assertEquals('has key <integer:0>', $constraint->toString());
     try {
         $constraint->fail(array(), '');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("Failed asserting that \nArray\n(\n)\n has key <integer:0>.", $e->getDescription());
         return;
     }
     $this->fail();
 }