Annotated routes with a variadic parameter
There are no variadic default values and that generate a fatal error.
This commit is contained in:
parent
69171d48ea
commit
9b7d4c7613
@ -0,0 +1,19 @@
|
|||||||
|
<?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 Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||||
|
|
||||||
|
class VariadicClass
|
||||||
|
{
|
||||||
|
public function routeAction(...$params)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Routing\Tests\Loader;
|
|||||||
|
|
||||||
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
|
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
|
class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
|
||||||
{
|
{
|
||||||
@ -34,6 +35,19 @@ class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
|
|||||||
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php');
|
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @requires PHP 5.6
|
||||||
|
*/
|
||||||
|
public function testLoadVariadic()
|
||||||
|
{
|
||||||
|
$route = new Route(["path" => "/path/to/{id}"]);
|
||||||
|
$this->reader->expects($this->once())->method('getClassAnnotation');
|
||||||
|
$this->reader->expects($this->once())->method('getMethodAnnotations')
|
||||||
|
->will($this->returnValue([$route]));
|
||||||
|
|
||||||
|
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/VariadicClass.php');
|
||||||
|
}
|
||||||
|
|
||||||
public function testSupports()
|
public function testSupports()
|
||||||
{
|
{
|
||||||
$fixture = __DIR__.'/../Fixtures/annotated.php';
|
$fixture = __DIR__.'/../Fixtures/annotated.php';
|
||||||
|
Reference in New Issue
Block a user