public function ProviderBasedGeneratorTest::testGenerateByRoute in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/Tests/Routing/ProviderBasedGeneratorTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\ProviderBasedGeneratorTest::testGenerateByRoute()
Tests the generate method with passing in a route object into generate().
@expectedException \Symfony\Component\Routing\Exception\InvalidParameterException
File
- vendor/
symfony-cmf/ routing/ Tests/ Routing/ ProviderBasedGeneratorTest.php, line 107
Class
Namespace
Symfony\Cmf\Component\Routing\Tests\RoutingCode
public function testGenerateByRoute() {
$this->generator = new ProviderBasedGenerator($this->provider);
// Setup a route with a numeric parameter, but pass in a string, so it
// fails and getRouteDebugMessage should be triggered.
$route = new Route('/test');
$route
->setPath('/test/{number}');
$route
->setRequirement('number', '\\+d');
$this->generator
->setStrictRequirements(true);
$context = new RequestContext();
$this->generator
->setContext($context);
$this
->assertSame(null, $this->generator
->generate($route, array(
'number' => 'string',
)));
}