@@ 38-48 (lines=11) @@ | ||
35 | $xmlns = 'http://symfony.com/schema/dic/doctrine'; |
|
36 | ||
37 | $dbalElements = $dom->getElementsByTagNameNS($xmlns, 'dbal'); |
|
38 | if ($dbalElements->length) { |
|
39 | $dbalDom = new DOMDocument('1.0', 'UTF-8'); |
|
40 | $dbalNode = $dbalDom->importNode($dbalElements->item(0)); |
|
41 | $configNode = $dbalDom->createElementNS($xmlns, 'config'); |
|
42 | $configNode->appendChild($dbalNode); |
|
43 | $dbalDom->appendChild($configNode); |
|
44 | ||
45 | $ret = $dbalDom->schemaValidate(__DIR__ . '/../../Resources/config/schema/doctrine-1.0.xsd'); |
|
46 | $this->assertTrue($ret, 'DoctrineBundle Dependency Injection XMLSchema did not validate this XML instance.'); |
|
47 | $found = true; |
|
48 | } |
|
49 | ||
50 | $ormElements = $dom->getElementsByTagNameNS($xmlns, 'orm'); |
|
51 | if ($ormElements->length) { |
|
@@ 51-61 (lines=11) @@ | ||
48 | } |
|
49 | ||
50 | $ormElements = $dom->getElementsByTagNameNS($xmlns, 'orm'); |
|
51 | if ($ormElements->length) { |
|
52 | $ormDom = new DOMDocument('1.0', 'UTF-8'); |
|
53 | $ormNode = $ormDom->importNode($ormElements->item(0)); |
|
54 | $configNode = $ormDom->createElementNS($xmlns, 'config'); |
|
55 | $configNode->appendChild($ormNode); |
|
56 | $ormDom->appendChild($configNode); |
|
57 | ||
58 | $ret = $ormDom->schemaValidate(__DIR__ . '/../../Resources/config/schema/doctrine-1.0.xsd'); |
|
59 | $this->assertTrue($ret, 'DoctrineBundle Dependency Injection XMLSchema did not validate this XML instance.'); |
|
60 | $found = true; |
|
61 | } |
|
62 | ||
63 | $this->assertTrue($found, 'Neither <doctrine:orm> nor <doctrine:dbal> elements found in given XML. Are namespaces configured correctly?'); |
|
64 | } |