Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

synchronize the fixtures in different formats and fix default for num…

…eric requirement
  • Loading branch information...
commit 9ffe3de642253fcaf2d5535d5ae37ed94630e71a 1 parent 6cd3457
@Tobion Tobion authored arnaud-lb committed
View
2  src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php
@@ -6,7 +6,7 @@
$collection->add('blog_show', new Route(
'/blog/{slug}',
array('_controller' => 'MyBlogBundle:Blog:show'),
- array('_method' => 'GET'),
+ array('_method' => 'GET', 'locale' => '\w+'),
array('compiler_class' => 'RouteCompiler'),
'{locale}.example.com'
));
View
1  src/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml
@@ -7,6 +7,7 @@
<route id="blog_show" pattern="/blog/{slug}" hostname-pattern="{locale}.example.com">
<default key="_controller">MyBundle:Blog:show</default>
<requirement key="_method">GET</requirement>
+ <requirement key="locale">\w+</requirement>
<option key="compiler_class">RouteCompiler</option>
</route>
</routes>
View
2  src/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml
@@ -2,6 +2,6 @@ blog_show:
pattern: /blog/{slug}
defaults: { _controller: MyBlogBundle:Blog:show }
hostname_pattern: "{locale}.example.com"
- requirements: { 'locale': '\d+' }
+ requirements: { '_method': 'GET', 'locale': '\w+' }
options:
compiler_class: RouteCompiler
View
2  src/Symfony/Component/Routing/Tests/Fixtures/validresource.xml
@@ -5,7 +5,7 @@
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<import resource="validpattern.xml" prefix="/{foo}" hostname-pattern="{locale}.example.com">
- <default key="foo">foo</default>
+ <default key="foo">123</default>
<requirement key="foo">\d+</requirement>
<option key="foo">bar</option>
</import>
View
2  src/Symfony/Component/Routing/Tests/Fixtures/validresource.yml
@@ -1,7 +1,7 @@
blog_show:
resource: validpattern.yml
prefix: /{foo}
- defaults: { 'foo': 'foo' }
+ defaults: { 'foo': '123' }
requirements: { 'foo': '\d+' }
options: { 'foo': 'bar' }
hostname_pattern: "{locale}.example.com"
View
3  src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
@@ -51,6 +51,7 @@ public function testLoadWithRoute()
$this->assertEquals('/blog/{slug}', $route->getPattern());
$this->assertEquals('MyBundle:Blog:show', $route->getDefault('_controller'));
$this->assertEquals('GET', $route->getRequirement('_method'));
+ $this->assertEquals('\w+', $route->getRequirement('locale'));
$this->assertEquals('{locale}.example.com', $route->getHostnamePattern());
$this->assertEquals('RouteCompiler', $route->getOption('compiler_class'));
}
@@ -65,7 +66,7 @@ public function testLoadWithImport()
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
$this->assertEquals('/{foo}/blog/{slug}', $routes['blog_show']->getPattern());
$this->assertEquals('MyBundle:Blog:show', $routes['blog_show']->getDefault('_controller'));
- $this->assertEquals('foo', $routes['blog_show']->getDefault('foo'));
+ $this->assertEquals('123', $routes['blog_show']->getDefault('foo'));
$this->assertEquals('\d+', $routes['blog_show']->getRequirement('foo'));
$this->assertEquals('bar', $routes['blog_show']->getOption('foo'));
$this->assertEquals('{locale}.example.com', $routes['blog_show']->getHostnamePattern());
View
5 src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php
@@ -90,7 +90,8 @@ public function testLoadWithPattern()
$route = $routes['blog_show'];
$this->assertEquals('/blog/{slug}', $route->getPattern());
$this->assertEquals('MyBlogBundle:Blog:show', $route->getDefault('_controller'));
- $this->assertEquals('\d+', $route->getRequirement('locale'));
+ $this->assertEquals('GET', $route->getRequirement('_method'));
+ $this->assertEquals('\w+', $route->getRequirement('locale'));
$this->assertEquals('{locale}.example.com', $route->getHostnamePattern());
$this->assertEquals('RouteCompiler', $route->getOption('compiler_class'));
}
@@ -105,7 +106,7 @@ public function testLoadWithResource()
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
$this->assertEquals('/{foo}/blog/{slug}', $routes['blog_show']->getPattern());
$this->assertEquals('MyBlogBundle:Blog:show', $routes['blog_show']->getDefault('_controller'));
- $this->assertEquals('foo', $routes['blog_show']->getDefault('foo'));
+ $this->assertEquals('123', $routes['blog_show']->getDefault('foo'));
$this->assertEquals('\d+', $routes['blog_show']->getRequirement('foo'));
$this->assertEquals('bar', $routes['blog_show']->getOption('foo'));
$this->assertEquals('{locale}.example.com', $routes['blog_show']->getHostnamePattern());
Please sign in to comment.
Something went wrong with that request. Please try again.