mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 20:18:52 +02:00
Updating Symfony lib and dependencies:
Package operations: 2 installs, 23 updates, 0 removals - Updating psr/log (1.1.0 => 1.1.2) - Updating symfony/debug (v3.4.30 => v3.4.35) - Updating symfony/console (v3.4.30 => v3.4.35) - Updating symfony/dotenv (v3.4.30 => v3.4.35) - Updating symfony/routing (v3.4.30 => v3.4.35) - Updating symfony/finder (v3.4.30 => v3.4.35) - Updating symfony/filesystem (v3.4.30 => v3.4.35) - Installing symfony/polyfill-util (v1.12.0) - Installing symfony/polyfill-php56 (v1.12.0) - Updating symfony/http-foundation (v3.4.30 => v3.4.35) - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35) - Updating symfony/http-kernel (v3.4.30 => v3.4.35) - Updating symfony/config (v3.4.30 => v3.4.35) - Updating symfony/dependency-injection (v3.4.30 => v3.4.35) - Updating symfony/class-loader (v3.4.30 => v3.4.35) - Updating symfony/cache (v3.4.30 => v3.4.35) - Updating symfony/framework-bundle (v3.4.30 => v3.4.35) - Updating twig/twig (v1.42.2 => v1.42.4) - Updating symfony/twig-bridge (v3.4.30 => v3.4.35) - Updating symfony/twig-bundle (v3.4.30 => v3.4.35) - Updating symfony/yaml (v3.4.30 => v3.4.35) - Updating symfony/stopwatch (v3.4.30 => v3.4.35) - Updating symfony/var-dumper (v3.4.30 => v3.4.35) - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35) - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Routing;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Routing\Router;
|
||||
use Symfony\Component\DependencyInjection\Config\ContainerParametersResource;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
|
||||
@@ -122,23 +123,21 @@ class RouterTest extends TestCase
|
||||
$routes->add('foo', new Route('/before/%parameter.foo%/after/%%escaped%%'));
|
||||
|
||||
$sc = $this->getServiceContainer($routes);
|
||||
$sc->setParameter('parameter.foo', 'foo');
|
||||
$sc->setParameter('parameter.foo', 'foo-%%escaped%%');
|
||||
|
||||
$router = new Router($sc, 'foo');
|
||||
$route = $router->getRouteCollection()->get('foo');
|
||||
|
||||
$this->assertEquals(
|
||||
'/before/foo/after/%escaped%',
|
||||
'/before/foo-%escaped%/after/%escaped%',
|
||||
$route->getPath()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Using "%env(FOO)%" is not allowed in routing configuration.
|
||||
*/
|
||||
public function testEnvPlaceholders()
|
||||
{
|
||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
|
||||
$this->expectExceptionMessage('Using "%env(FOO)%" is not allowed in routing configuration.');
|
||||
$routes = new RouteCollection();
|
||||
|
||||
$routes->add('foo', new Route('/%env(FOO)%'));
|
||||
@@ -147,6 +146,22 @@ class RouterTest extends TestCase
|
||||
$router->getRouteCollection();
|
||||
}
|
||||
|
||||
public function testIndirectEnvPlaceholders()
|
||||
{
|
||||
$routes = new RouteCollection();
|
||||
|
||||
$routes->add('foo', new Route('/%foo%'));
|
||||
|
||||
$router = new Router($container = $this->getServiceContainer($routes), 'foo');
|
||||
$container->setParameter('foo', 'foo-%bar%');
|
||||
$container->setParameter('bar', '%env(string:FOO)%');
|
||||
|
||||
$this->expectException(RuntimeException::class);
|
||||
$this->expectExceptionMessage('Using "%env(string:FOO)%" is not allowed in routing configuration.');
|
||||
|
||||
$router->getRouteCollection();
|
||||
}
|
||||
|
||||
public function testHostPlaceholders()
|
||||
{
|
||||
$routes = new RouteCollection();
|
||||
@@ -168,12 +183,10 @@ class RouterTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException
|
||||
* @expectedExceptionMessage You have requested a non-existent parameter "nope".
|
||||
*/
|
||||
public function testExceptionOnNonExistentParameter()
|
||||
{
|
||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException');
|
||||
$this->expectExceptionMessage('You have requested a non-existent parameter "nope".');
|
||||
$routes = new RouteCollection();
|
||||
|
||||
$routes->add('foo', new Route('/%nope%'));
|
||||
@@ -184,12 +197,10 @@ class RouterTest extends TestCase
|
||||
$router->getRouteCollection()->get('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type object.
|
||||
*/
|
||||
public function testExceptionOnNonStringParameter()
|
||||
{
|
||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
|
||||
$this->expectExceptionMessage('The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type object.');
|
||||
$routes = new RouteCollection();
|
||||
|
||||
$routes->add('foo', new Route('/%object%'));
|
||||
|
||||
Reference in New Issue
Block a user