toString() public méthode

Returns a string representation of the constraint.
public toString ( ) : string
Résultat string
 public function testConstraintTraversableNotContains()
 {
     $constraint = new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_TraversableContains('foo'));
     $this->assertTrue($constraint->evaluate(array('bar')));
     $this->assertFalse($constraint->evaluate(array('foo')));
     $this->assertEquals('does not contain <string:foo>', $constraint->toString());
     try {
         $constraint->fail(array('foo'), '');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("Failed asserting that \nArray\n(\n    [0] => foo\n)\n does not contain <string:foo>.", $e->getDescription());
         return;
     }
     $this->fail();
 }