[Routing] fixed Route annotation for hostname (should be hostname_pattern instead of hostnamePattern)

This commit is contained in:
Fabien Potencier 2012-04-25 03:14:38 +02:00 committed by Arnaud Le Blanc
parent 62de881ddb
commit d91e5a26a2
2 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class Route
}
foreach ($data as $key => $value) {
$method = 'set'.$key;
$method = 'set'.str_replace('_', '', $key);
if (!method_exists($this, $method)) {
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
}

View File

@ -39,7 +39,8 @@ class RouteTest extends \PHPUnit_Framework_TestCase
array('requirements', array('_method' => 'GET'), 'getRequirements'),
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
array('name', 'blog_index', 'getName'),
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults')
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
array('hostname_pattern', array('{locale}.example.com'), 'getHostnamePattern')
);
}
}