[Routing] use American English
This commit is contained in:
parent
d4bfbb8152
commit
2004092dae
@ -24,7 +24,7 @@
|
|||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
|
|
||||||
<xsd:complexType name="localised-path">
|
<xsd:complexType name="localized-path">
|
||||||
<xsd:simpleContent>
|
<xsd:simpleContent>
|
||||||
<xsd:extension base="xsd:string">
|
<xsd:extension base="xsd:string">
|
||||||
<xsd:attribute name="locale" type="xsd:string" use="required" />
|
<xsd:attribute name="locale" type="xsd:string" use="required" />
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<xsd:complexType name="route">
|
<xsd:complexType name="route">
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
|
||||||
<xsd:element name="path" type="localised-path" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:element name="path" type="localized-path" minOccurs="0" maxOccurs="unbounded" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="id" type="xsd:string" use="required" />
|
<xsd:attribute name="id" type="xsd:string" use="required" />
|
||||||
<xsd:attribute name="path" type="xsd:string" />
|
<xsd:attribute name="path" type="xsd:string" />
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<xsd:complexType name="import">
|
<xsd:complexType name="import">
|
||||||
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
||||||
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
|
||||||
<xsd:element name="prefix" type="localised-path" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:element name="prefix" type="localized-path" minOccurs="0" maxOccurs="unbounded" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="resource" type="xsd:string" use="required" />
|
<xsd:attribute name="resource" type="xsd:string" use="required" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||||
|
|
||||||
<route id="localised">
|
<route id="localized">
|
||||||
<default key="_controller">MyBundle:Blog:show</default>
|
<default key="_controller">MyBundle:Blog:show</default>
|
||||||
<path locale="en">/path</path>
|
<path locale="en">/path</path>
|
||||||
<path locale="fr">/route</path>
|
<path locale="fr">/route</path>
|
@ -86,17 +86,17 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
public function testLoadLocalized()
|
public function testLoadLocalized()
|
||||||
{
|
{
|
||||||
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
|
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
|
||||||
$routeCollection = $loader->load('localised.xml');
|
$routeCollection = $loader->load('localized.xml');
|
||||||
$routes = $routeCollection->all();
|
$routes = $routeCollection->all();
|
||||||
|
|
||||||
$this->assertCount(2, $routes, 'Two routes are loaded');
|
$this->assertCount(2, $routes, 'Two routes are loaded');
|
||||||
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
|
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
|
||||||
|
|
||||||
$this->assertEquals('/route', $routeCollection->get('localised.fr')->getPath());
|
$this->assertEquals('/route', $routeCollection->get('localized.fr')->getPath());
|
||||||
$this->assertEquals('/path', $routeCollection->get('localised.en')->getPath());
|
$this->assertEquals('/path', $routeCollection->get('localized.en')->getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLocalisedImports()
|
public function testLocalizedImports()
|
||||||
{
|
{
|
||||||
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
|
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
|
||||||
$routeCollection = $loader->load('importer-with-locale.xml');
|
$routeCollection = $loader->load('importer-with-locale.xml');
|
||||||
@ -109,7 +109,7 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
$this->assertEquals('/the-prefix/suffix', $routeCollection->get('imported.en')->getPath());
|
$this->assertEquals('/the-prefix/suffix', $routeCollection->get('imported.en')->getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLocalisedImportsOfNotLocalizedRoutes()
|
public function testLocalizedImportsOfNotLocalizedRoutes()
|
||||||
{
|
{
|
||||||
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
|
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
|
||||||
$routeCollection = $loader->load('importer-with-locale-imports-non-localized-route.xml');
|
$routeCollection = $loader->load('importer-with-locale-imports-non-localized-route.xml');
|
||||||
|
Reference in New Issue
Block a user