try { $loader->parseFile($fixturesPath.'/ini/parameters.ini'); $t->fail('->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); } catch (InvalidArgumentException $e) { $t->pass('->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); } $loader = new ProjectLoader($fixturesPath.'/xml'); try { $loader->parseFile($fixturesPath.'/xml/nonvalid.xml'); $t->fail('->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); } catch (InvalidArgumentException $e) { $t->pass('->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); } $xml = $loader->parseFile($fixturesPath.'/xml/services1.xml'); $t->is(get_class($xml), 'Symfony\\Components\\DependencyInjection\\SimpleXMLElement', '->parseFile() returns an SimpleXMLElement object'); // ->load() # parameters $t->diag('->load() # parameters'); $loader = new ProjectLoader($fixturesPath.'/xml'); $config = $loader->load('services2.xml'); $t->is($config->getParameters(), 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')), '->load() converts XML values to PHP ones');