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

Commit 3f34e06

Browse files
committed
Merge pull request #58 from WouterJ/xml_schema
Created XML schema
2 parents fc900c1 + 4fb415b commit 3f34e06

File tree

4 files changed

+106
-1
lines changed

4 files changed

+106
-1
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<xsd:schema xmlns="http://cmf.symfony.com/schema/dic/routing_auto"
4+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5+
targetNamespace="http://cmf.symfony.com/schema/dic/routing_auto"
6+
elementFormDefault="qualified">
7+
8+
<xsd:element name="config" type="config" />
9+
10+
<xsd:complexType name="config">
11+
<xsd:sequence>
12+
<xsd:element name="mapping" type="mapping" minOccurs="0" />
13+
</xsd:sequence>
14+
</xsd:complexType>
15+
16+
<xsd:complexType name="mapping">
17+
<xsd:sequence>
18+
<xsd:element name="content-path" type="content-path" minOccurs="0" />
19+
<xsd:element name="content-name" type="content-name" />
20+
</xsd:sequence>
21+
22+
<xsd:attribute name="class" type="xsd:string" />
23+
</xsd:complexType>
24+
25+
<xsd:complexType name="content-path">
26+
<xsd:sequence>
27+
<xsd:element name="path-unit" type="path-unit" minOccurs="0" maxOccurs="unbounded" />
28+
</xsd:sequence>
29+
</xsd:complexType>
30+
31+
<xsd:complexType name="path-unit">
32+
<xsd:sequence>
33+
<xsd:element name="provider" type="provider" minOccurs="0" />
34+
<xsd:element name="exists-action" type="action" minOccurs="0" />
35+
<xsd:element name="not-exists-action" type="action" minOccurs="0" />
36+
</xsd:sequence>
37+
38+
<xsd:attribute name="name" type="xsd:string" />
39+
</xsd:complexType>
40+
41+
<xsd:complexType name="content-name">
42+
<xsd:sequence>
43+
<xsd:element name="provider" type="provider" minOccurs="0" />
44+
<xsd:element name="exists-action" type="action" minOccurs="0" />
45+
<xsd:element name="not-exists-action" type="action" minOccurs="0" />
46+
</xsd:sequence>
47+
</xsd:complexType>
48+
49+
<xsd:complexType name="provider">
50+
<xsd:sequence>
51+
<xsd:element name="option" type="option" minOccurs="0" maxOccurs="unbounded" />
52+
</xsd:sequence>
53+
54+
<xsd:attribute name="name" type="xsd:string" />
55+
</xsd:complexType>
56+
57+
<xsd:complexType name="action">
58+
<xsd:sequence>
59+
<xsd:element name="option" type="option" minOccurs="0" maxOccurs="unbounded" />
60+
</xsd:sequence>
61+
62+
<xsd:attribute name="strategy" type="xsd:string" />
63+
</xsd:complexType>
64+
65+
<xsd:complexType name="option">
66+
<xsd:simpleContent>
67+
<xsd:extension base="xsd:string">
68+
<xsd:attribute name="name" type="xsd:string" />
69+
<xsd:attribute name="value" type="xsd:string" />
70+
</xsd:extension>
71+
</xsd:simpleContent>
72+
</xsd:complexType>
73+
</xsd:schema>
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+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"doctrine/phpcr-odm": "dev-master as 1.0.x-dev"
1818
},
1919
"require-dev": {
20-
"symfony-cmf/testing": "1.0.*",
20+
"symfony-cmf/testing": "1.1.*",
2121
"matthiasnoback/symfony-dependency-injection-test": "0.*",
2222
"matthiasnoback/symfony-config-test": "0.*"
2323
},

0 commit comments

Comments
 (0)