Yaffs site version 1.1
[yaffs-website] / vendor / symfony / validator / Tests / Constraints / AllTest.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 PHPUnit\Framework\TestCase;
15 use Symfony\Component\Validator\Constraints\All;
16 use Symfony\Component\Validator\Constraints\Valid;
17
18 /**
19  * @author Bernhard Schussek <bschussek@gmail.com>
20  */
21 class AllTest extends TestCase
22 {
23     /**
24      * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
25      */
26     public function testRejectNonConstraints()
27     {
28         new All(array(
29             'foo',
30         ));
31     }
32
33     /**
34      * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
35      */
36     public function testRejectValidConstraint()
37     {
38         new All(array(
39             new Valid(),
40         ));
41     }
42 }