File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/Symfony/Component/Routing/Tests
Fixtures/AnnotatedClasses Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
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 \Routing \Tests \Fixtures \AnnotatedClasses ;
13
+
14
+ class VariadicClass
15
+ {
16
+ public function routeAction (...$ params )
17
+ {
18
+ }
19
+ }
Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Component \Routing \Loader \AnnotationFileLoader ;
15
15
use Symfony \Component \Config \FileLocator ;
16
+ use Symfony \Component \Routing \Annotation \Route ;
16
17
17
18
class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
18
19
{
@@ -34,6 +35,19 @@ public function testLoad()
34
35
$ this ->loader ->load (__DIR__ .'/../Fixtures/AnnotatedClasses/FooClass.php ' );
35
36
}
36
37
38
+ /**
39
+ * @requires PHP 5.6
40
+ */
41
+ public function testLoadVariadic ()
42
+ {
43
+ $ route = new Route (["path " => "/path/to/{id} " ]);
44
+ $ this ->reader ->expects ($ this ->once ())->method ('getClassAnnotation ' );
45
+ $ this ->reader ->expects ($ this ->once ())->method ('getMethodAnnotations ' )
46
+ ->will ($ this ->returnValue ([$ route ]));
47
+
48
+ $ this ->loader ->load (__DIR__ .'/../Fixtures/AnnotatedClasses/VariadicClass.php ' );
49
+ }
50
+
37
51
public function testSupports ()
38
52
{
39
53
$ fixture = __DIR__ .'/../Fixtures/annotated.php ' ;
You can’t perform that action at this time.
0 commit comments