You are here

public function PhpGeneratorDumperTest::testGenerateNonExistingRoute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php \Symfony\Component\Routing\Tests\Generator\Dumper\PhpGeneratorDumperTest::testGenerateNonExistingRoute()

@expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException

File

vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php, line 94

Class

PhpGeneratorDumperTest

Namespace

Symfony\Component\Routing\Tests\Generator\Dumper

Code

public function testGenerateNonExistingRoute() {
  $this->routeCollection
    ->add('Test', new Route('/test'));
  file_put_contents($this->testTmpFilepath, $this->generatorDumper
    ->dump(array(
    'class' => 'NonExistingRoutesUrlGenerator',
  )));
  include $this->testTmpFilepath;
  $projectUrlGenerator = new \NonExistingRoutesUrlGenerator(new RequestContext());
  $url = $projectUrlGenerator
    ->generate('NonExisting', array());
}