function Assert::fileExists
Same name in this branch
- 11.1.x vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit\Framework\Assert::fileExists()
Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.
Parameters
mixed $value:
string $message:
Throws
2 calls to Assert::fileExists()
- Assert::directory in vendor/
webmozart/ assert/ src/ Assert.php - Assert::file in vendor/
webmozart/ assert/ src/ Assert.php
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 1427
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function fileExists($value, $message = '') {
static::string($value);
if (!\file_exists($value)) {
static::reportInvalidArgument(\sprintf($message ?: 'The file %s does not exist.', static::valueToString($value)));
}
}