2018-06-17 04:18:56 +02:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-02-09 11:44:33 +01:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-06-17 04:18:56 +02:00
|
|
|
require 'vendor/autoload.php';
|
|
|
|
|
|
|
|
use Respect\Validation\Validator as v;
|
|
|
|
|
2023-04-01 07:20:05 +02:00
|
|
|
exceptionMessage(static fn() => v::exists()->check('/path/of/a/non-existent/file'));
|
|
|
|
exceptionMessage(static fn() => v::not(v::exists())->check('tests/fixtures/valid-image.gif'));
|
|
|
|
exceptionFullMessage(static fn() => v::exists()->assert('/path/of/a/non-existent/file'));
|
|
|
|
exceptionFullMessage(static fn() => v::not(v::exists())->assert('tests/fixtures/valid-image.png'));
|
2018-06-17 04:18:56 +02:00
|
|
|
?>
|
2018-12-19 18:05:58 +01:00
|
|
|
--EXPECT--
|
2023-03-22 19:06:15 +01:00
|
|
|
"/path/of/a/non-existent/file" must exist
|
|
|
|
"tests/fixtures/valid-image.gif" must not exist
|
|
|
|
- "/path/of/a/non-existent/file" must exist
|
|
|
|
- "tests/fixtures/valid-image.png" must not exist
|