You are here

public function PhpGeneratorDumperTest::testDumpForRouteWithDefaults in Zircon Profile 8.0

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

File

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

Class

PhpGeneratorDumperTest

Namespace

Symfony\Component\Routing\Tests\Generator\Dumper

Code

public function testDumpForRouteWithDefaults() {
  $this->routeCollection
    ->add('Test', new Route('/testing/{foo}', array(
    'foo' => 'bar',
  )));
  file_put_contents($this->testTmpFilepath, $this->generatorDumper
    ->dump(array(
    'class' => 'DefaultRoutesUrlGenerator',
  )));
  include $this->testTmpFilepath;
  $projectUrlGenerator = new \DefaultRoutesUrlGenerator(new RequestContext());
  $url = $projectUrlGenerator
    ->generate('Test', array());
  $this
    ->assertEquals($url, '/testing');
}