11b8d4cb7987ce347d25f384c9e2ddf3e7bfd84a
[yaffs-website] / vendor / symfony / validator / Tests / Constraints / FileValidatorPathTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Tests\Constraints;
13
14 use Symfony\Component\Validator\Constraints\File;
15
16 class FileValidatorPathTest extends FileValidatorTest
17 {
18     protected function getFile($filename)
19     {
20         return $filename;
21     }
22
23     public function testFileNotFound()
24     {
25         $constraint = new File(array(
26             'notFoundMessage' => 'myMessage',
27         ));
28
29         $this->validator->validate('foobar', $constraint);
30
31         $this->buildViolation('myMessage')
32             ->setParameter('{{ file }}', '"foobar"')
33             ->setCode(File::NOT_FOUND_ERROR)
34             ->assertRaised();
35     }
36 }