evaluate() 공개 메소드

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.
리턴 boolean
예제 #1
0
 public function testConstraintFileExists()
 {
     $constraint = new PHPUnit_Framework_Constraint_FileExists();
     $this->assertFalse($constraint->evaluate('foo'));
     $this->assertEquals('file exists', $constraint->toString());
     try {
         $constraint->fail('foo', '');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals('Failed asserting that file "foo" exists.', $e->getDescription());
         return;
     }
     $this->fail();
 }