Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4fb415b

Browse files
committed
Created schema test and fixed schema
1 parent 24eb4d4 commit 4fb415b

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

Resources/config/schema/routing-auto-1.0.xsd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99

1010
<xsd:complexType name="config">
1111
<xsd:sequence>
12-
<xsd:element name="mappings" type="mappings" minOccurs="0" />
12+
<xsd:element name="mapping" type="mapping" minOccurs="0" />
1313
</xsd:sequence>
1414
</xsd:complexType>
1515

16-
<xsd:complexType name="mappings">
16+
<xsd:complexType name="mapping">
1717
<xsd:sequence>
1818
<xsd:element name="content-path" type="content-path" minOccurs="0" />
1919
<xsd:element name="content-name" type="content-name" />
2020
</xsd:sequence>
21+
22+
<xsd:attribute name="class" type="xsd:string" />
2123
</xsd:complexType>
2224

2325
<xsd:complexType name="content-path">
2426
<xsd:sequence>
25-
<xsd:element name="path-unit" type="content-identity" minOccurs="0" maxOccurs="unbounded" />
27+
<xsd:element name="path-unit" type="path-unit" minOccurs="0" maxOccurs="unbounded" />
2628
</xsd:sequence>
27-
28-
<xsd:attribute name="name" type="xsd:string" />
2929
</xsd:complexType>
3030

3131
<xsd:complexType name="path-unit">
@@ -34,6 +34,8 @@
3434
<xsd:element name="exists-action" type="action" minOccurs="0" />
3535
<xsd:element name="not-exists-action" type="action" minOccurs="0" />
3636
</xsd:sequence>
37+
38+
<xsd:attribute name="name" type="xsd:string" />
3739
</xsd:complexType>
3840

3941
<xsd:complexType name="content-name">
@@ -62,7 +64,7 @@
6264

6365
<xsd:complexType name="option">
6466
<xsd:simpleContent>
65-
<xsd:extension base="xs:string">
67+
<xsd:extension base="xsd:string">
6668
<xsd:attribute name="name" type="xsd:string" />
6769
<xsd:attribute name="value" type="xsd:string" />
6870
</xsd:extension>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<config xmlns="http://cmf.symfony.com/schema/dic/routing_auto">
2+
</config>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony CMF package.
5+
*
6+
* (c) 2011-2013 Symfony CMF
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
13+
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Unit\DependencyInjection;
14+
15+
use Symfony\Cmf\Component\Testing\Unit\XmlSchemaTestCase;
16+
17+
class XmlSchemaTest extends XmlSchemaTestCase
18+
{
19+
public function testSchema()
20+
{
21+
$xmlFiles = array_map(function ($file) {
22+
return __DIR__.'/../../Resources/Fixtures/config/'.$file;
23+
}, array(
24+
'config1.xml',
25+
'config.xml',
26+
));
27+
28+
$this->assertSchemaAcceptsXml($xmlFiles, __DIR__.'/../../../Resources/config/schema/routing-auto-1.0.xsd');
29+
}
30+
}

0 commit comments

Comments
 (0)