Null default value route regression
This commit is contained in:
parent
5f6a17b8cc
commit
a1d1a02b47
@ -144,6 +144,19 @@ class RoutingTest extends \PHPUnit_Framework_TestCase
|
|||||||
$router->getRouteCollection()->get('foo');
|
$router->getRouteCollection()->get('foo');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDefaultValueNullAsEmptyStringRegression()
|
||||||
|
{
|
||||||
|
$routes = new RouteCollection();
|
||||||
|
$routes->add('foo', new Route('foo', array('foo' => null), array('foo' => '\d+')));
|
||||||
|
|
||||||
|
$sc = $this->getServiceContainer($routes);
|
||||||
|
|
||||||
|
$router = new Router($sc, 'foo');
|
||||||
|
|
||||||
|
$route = $router->getRouteCollection()->get('foo');
|
||||||
|
$this->assertNull($route->getDefault('foo'));
|
||||||
|
}
|
||||||
|
|
||||||
private function getServiceContainer(RouteCollection $routes)
|
private function getServiceContainer(RouteCollection $routes)
|
||||||
{
|
{
|
||||||
$loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
|
$loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
|
||||||
|
Reference in New Issue
Block a user