Вход Регистрация
Файл: symfony-2.7/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php
Строк: 38
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace SymfonyComponentValidatorTestsConstraints;

use 
SymfonyComponentValidatorConstraintsFile;

class 
FileValidatorPathTest extends FileValidatorTest
{
    protected function 
getFile($filename)
    {
        return 
$filename;
    }

    public function 
testFileNotFound()
    {
        
$constraint = new File(array(
            
'notFoundMessage' => 'myMessage',
        ));

        
$this->validator->validate('foobar'$constraint);

        
$this->buildViolation('myMessage')
            ->
setParameter('{{ file }}''"foobar"')
            ->
setCode(File::NOT_FOUND_ERROR)
            ->
assertRaised();
    }
}
Онлайн: 1
Реклама