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

Commit 45d62a9

Browse files
committed
Merge pull request #54 from symfony-cmf/fix-xml-confg
fix xml configuration schema
2 parents 370e4e1 + 9f8213b commit 45d62a9

File tree

6 files changed

+52
-1
lines changed

6 files changed

+52
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ vendor
22
composer.lock
33
composer.phar
44
Tests/Resources/app/cache
5+
Tests/Resources/app/logs

Resources/config/schema/treebrowser-1.0.xsd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
<xsd:element name="config" type="config" />
99

1010
<xsd:complexType name="config">
11+
<xsd:sequence>
12+
<xsd:element name="persistence" type="persistence" minOccurs="0"/>
13+
</xsd:sequence>
14+
</xsd:complexType>
15+
16+
<xsd:complexType name="persistence">
17+
<xsd:sequence>
18+
<xsd:element name="phpcr" type="phpcr" minOccurs="0"/>
19+
</xsd:sequence>
20+
</xsd:complexType>
21+
22+
<xsd:complexType name="phpcr">
23+
<xsd:attribute name="enabled" type="xsd:boolean" />
1124
<xsd:attribute name="session-name" type="xsd:string" />
1225
</xsd:complexType>
1326
</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/treebrowser">
2+
</config>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<config xmlns="http://cmf.symfony.com/schema/dic/treebrowser">
2+
<persistence>
3+
<phpcr
4+
session-name="default"
5+
/>
6+
</persistence>
7+
</config>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/*
3+
* This file is part of the Symfony CMF package.
4+
*
5+
* (c) 2011-2013 Symfony CMF
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace Symfony\Cmf\Bundle\TreeBrowserBundle\Tests\Unit\DependencyInjection;
12+
13+
use Symfony\Cmf\Component\Testing\Unit\XmlSchemaTestCase;
14+
15+
class XmlSchemaTest extends XmlSchemaTestCase
16+
{
17+
public function testSchema()
18+
{
19+
$xmlFiles = array_map(function ($file) {
20+
return __DIR__.'/../../Resources/Fixtures/config/'.$file;
21+
}, array(
22+
'config1.xml',
23+
'config2.xml',
24+
));
25+
26+
$this->assertSchemaAcceptsXml($xmlFiles, __DIR__.'/../../../Resources/config/schema/treebrowser-1.0.xsd');
27+
}
28+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"friendsofsymfony/jsrouting-bundle": "~1.1"
1919
},
2020
"require-dev": {
21-
"symfony-cmf/testing": "1.0.*"
21+
"symfony-cmf/testing": "1.1.*"
2222
},
2323
"suggest": {
2424
"doctrine/phpcr-bundle": "1.0.*",

0 commit comments

Comments
 (0)