1111
1212namespace FOS \RestBundle \Tests \Controller \Annotations ;
1313
14+ use FOS \RestBundle \Controller \Annotations \AbstractScalarParam ;
1415use FOS \RestBundle \Validator \Constraints \Regex ;
1516use PHPUnit \Framework \TestCase ;
17+ use Symfony \Component \Validator \Constraint ;
1618use Symfony \Component \Validator \Constraints ;
1719
1820/**
@@ -24,12 +26,12 @@ class AbstractScalarParamTest extends TestCase
2426{
2527 public function setUp ()
2628 {
27- $ this ->param = $ this ->getMockForAbstractClass (' FOS\RestBundle\Controller\Annotations\ AbstractScalarParam' );
29+ $ this ->param = $ this ->getMockForAbstractClass (AbstractScalarParam::class );
2830 }
2931
3032 public function testInterface ()
3133 {
32- $ this ->assertInstanceOf (' FOS\RestBundle\Controller\Annotations\AbstractParam ' , $ this ->param );
34+ $ this ->assertInstanceOf (AbstractScalarParam::class , $ this ->param );
3335 }
3436
3537 public function testDefaultValues ()
@@ -48,13 +50,26 @@ public function testScalarConstraint()
4850
4951 public function testComplexRequirements ()
5052 {
51- $ this ->param ->requirements = $ requirement = $ this ->getMockBuilder (' Symfony\Component\Validator\ Constraint' )->getMock ();
53+ $ this ->param ->requirements = $ requirement = $ this ->getMockBuilder (Constraint::class )->getMock ();
5254 $ this ->assertEquals (array (
5355 new Constraints \NotNull (),
5456 $ requirement ,
5557 ), $ this ->param ->getConstraints ());
5658 }
5759
60+ public function testMultipleComplexRequirements ()
61+ {
62+ $ requirement1 = $ this ->getMockBuilder (Constraint::class)->getMock ();
63+ $ requirement2 = $ this ->getMockBuilder (Constraint::class)->getMock ();
64+ $ this ->param ->requirements = array ($ requirement1 , $ requirement2 );
65+
66+ $ this ->assertEquals (array (
67+ new Constraints \NotNull (),
68+ $ requirement1 ,
69+ $ requirement2 ,
70+ ), $ this ->param ->getConstraints ());
71+ }
72+
5873 public function testScalarRequirements ()
5974 {
6075 $ this ->param ->name = 'bar ' ;
0 commit comments