The file path to check is passed as $other in evaluate().
Наследование: extends PHPUnit_Framework_Constraint
Пример #1
0
 public function testFailureFileExists2()
 {
     $constraint = new PHPUnit_Framework_Constraint_FileExists();
     try {
         $constraint->fail('foo', 'custom message');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that file \"foo\" exists.\n", PHPUnit_Framework_TestFailure::exceptionToString($e));
         return;
     }
     $this->fail();
 }
Пример #2
0
 public function testConstraintFileExists2()
 {
     $constraint = new PHPUnit_Framework_Constraint_FileExists();
     try {
         $constraint->fail('foo', 'custom message');
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that file \"foo\" exists.", $e->getDescription());
         return;
     }
     $this->fail();
 }
Пример #3
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();
 }