You are here

public function UrlGeneratorTest::testRelativeUrlWithNullParameterButNotOptional in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php \Symfony\Component\Routing\Tests\Generator\UrlGeneratorTest::testRelativeUrlWithNullParameterButNotOptional()

@expectedException \Symfony\Component\Routing\Exception\InvalidParameterException

File

vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php, line 81

Class

UrlGeneratorTest

Namespace

Symfony\Component\Routing\Tests\Generator

Code

public function testRelativeUrlWithNullParameterButNotOptional() {
  $routes = $this
    ->getRoutes('test', new Route('/testing/{foo}/bar', array(
    'foo' => null,
  )));

  // This must raise an exception because the default requirement for "foo" is "[^/]+" which is not met with these params.
  // Generating path "/testing//bar" would be wrong as matching this route would fail.
  $this
    ->getGenerator($routes)
    ->generate('test', array(), false);
}