Skip to content

Commit

Permalink
remove service parameter type from XSD
Browse files Browse the repository at this point in the history
Referencing a service in a parameter doesn't work and will lead to an
error when the configuration is loaded.
  • Loading branch information
xabbuh committed Sep 13, 2014
1 parent b33d637 commit 7333c2d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -156,7 +156,6 @@
<xsd:simpleType name="parameter_type">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="collection" />
<xsd:enumeration value="service" />
<xsd:enumeration value="string" />
<xsd:enumeration value="constant" />
</xsd:restriction>
Expand Down
Expand Up @@ -23,7 +23,6 @@
<parameter>bar</parameter>
</parameter>
</parameter>
<parameter key="foo_bar" type="service" id="foo_bar" />
<parameter key="MixedCase" type="collection"> <!-- Should be lower cased -->
<parameter key="MixedCaseKey">value</parameter> <!-- Should stay mixed case -->
</parameter>
Expand Down
Expand Up @@ -99,7 +99,7 @@ public function testLoadParameters()
$loader->load('services2.xml');

$actual = $container->getParameterBag()->all();
$expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'));
$expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'mixedcase' => array('MixedCaseKey' => 'value'));

$this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones');
}
Expand All @@ -120,7 +120,7 @@ public function testLoadImports()
$loader->load('services4.xml');

$actual = $container->getParameterBag()->all();
$expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true);
$expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true);

$this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files');

Expand Down

0 comments on commit 7333c2d

Please sign in to comment.