File tree 3 files changed +35
-1
lines changed
src/Symfony/Component/Routing
3 files changed +35
-1
lines changed
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <routes xmlns =" http://symfony.com/schema/routing"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://symfony.com/schema/routing
5
+ http://symfony.com/schema/routing/routing-1.0.xsd" >
6
+
7
+ <route id =" app_utf8" path =" /utf8" >
8
+ <option key =" utf8" >true</option >
9
+ </route >
10
+ <route id =" app_no_utf8" path =" /no-utf8" >
11
+ <option key =" utf8" >false</option >
12
+ </route >
13
+ </routes >
Original file line number Diff line number Diff line change @@ -83,6 +83,26 @@ public function testLoadWithImport()
83
83
}
84
84
}
85
85
86
+ public function testUtf8Route ()
87
+ {
88
+ $ loader = new XmlFileLoader (new FileLocator ([__DIR__ .'/../Fixtures/localized ' ]));
89
+ $ routeCollection = $ loader ->load ('utf8.xml ' );
90
+ $ routes = $ routeCollection ->all ();
91
+
92
+ $ this ->assertCount (2 , $ routes , 'Two routes are loaded ' );
93
+ $ this ->assertContainsOnly ('Symfony\Component\Routing\Route ' , $ routes );
94
+
95
+ $ utf8Route = $ routeCollection ->get ('app_utf8 ' );
96
+
97
+ $ this ->assertSame ('/utf8 ' , $ utf8Route ->getPath ());
98
+ $ this ->assertTrue ($ utf8Route ->getOption ('utf8 ' ), 'Must be utf8 ' );
99
+
100
+ $ noUtf8Route = $ routeCollection ->get ('app_no_utf8 ' );
101
+
102
+ $ this ->assertSame ('/no-utf8 ' , $ noUtf8Route ->getPath ());
103
+ $ this ->assertFalse ($ noUtf8Route ->getOption ('utf8 ' ), 'Must not be utf8 ' );
104
+ }
105
+
86
106
/**
87
107
* @expectedException \InvalidArgumentException
88
108
* @dataProvider getPathsToInvalidFiles
You can’t perform that action at this time.
0 commit comments