3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * Constraint that checks if the file(name) that it is evaluated for exists.
14 * The file path to check is passed as $other in evaluate().
16 * @since Class available since Release 3.0.0
18 class PHPUnit_Framework_Constraint_FileExists extends PHPUnit_Framework_Constraint
21 * Evaluates the constraint for parameter $other. Returns true if the
22 * constraint is met, false otherwise.
24 * @param mixed $other Value or object to evaluate.
28 protected function matches($other)
30 return file_exists($other);
34 * Returns the description of the failure
36 * The beginning of failure messages is "Failed asserting that" in most
37 * cases. This method should return the second part of that sentence.
39 * @param mixed $other Evaluated value or object.
43 protected function failureDescription($other)
52 * Returns a string representation of the constraint.
56 public function toString()