PHPUnit_Framework_Assert::fileExists PHP Method

fileExists() public static method

Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
public static fileExists ( ) : PHPUnit_Framework_Constraint_FileExists
return PHPUnit_Framework_Constraint_FileExists
    public static function fileExists()
    {
        return new PHPUnit_Framework_Constraint_FileExists();
    }

Usage Example

 /**
  * @covers PHPUnit_Framework_Constraint_FileExists
  * @covers PHPUnit_Framework_Constraint_Not
  * @covers PHPUnit_Framework_Assert::logicalNot
  * @covers PHPUnit_Framework_Assert::fileExists
  */
 public function testConstraintFileNotExists2()
 {
     $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::fileExists());
     try {
         $constraint->fail('foo', 'custom message', TRUE);
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that file \"foo\" does not exist.", $e->getDescription());
         return;
     }
     $this->fail();
 }
All Usage Examples Of PHPUnit_Framework_Assert::fileExists
PHPUnit_Framework_Assert