PHPUnit_Framework_Constraint_FileExists::evaluate PHP Метод

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
    public function evaluate($other)
    {
        return file_exists($other);
    }

Usage Example

Пример #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();
 }
PHPUnit_Framework_Constraint_FileExists