public function PhpGeneratorDumperTest::testGenerateNonExistingRoute

@expectedException Symfony\Component\Routing\Exception\RouteNotFoundException

File

drupal/core/vendor/symfony/routing/Symfony/Component/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());
}