$loader = new ProjectLoader($fixturesPath . '/ini');
try {
    $loader->getFilesAsXml(array('foo.xml'));
    $t->fail('->load() throws an InvalidArgumentException if the loaded file does not exist');
} catch (InvalidArgumentException $e) {
    $t->pass('->load() throws an InvalidArgumentException if the loaded file does not exist');
}
try {
    $loader->getFilesAsXml(array('parameters.ini'));
    $t->fail('->load() throws an InvalidArgumentException if the loaded file is not a valid XML file');
} catch (InvalidArgumentException $e) {
    $t->pass('->load() throws an InvalidArgumentException if the loaded file is not a valid XML file');
}
$loader = new ProjectLoader($fixturesPath . '/xml');
try {
    $loader->getFilesAsXml(array('nonvalid.xml'));
    $t->fail('->load() throws an InvalidArgumentException if the loaded file does not validate the XSD');
} catch (InvalidArgumentException $e) {
    $t->pass('->load() throws an InvalidArgumentException if the loaded file does not validate the XSD');
}
$xmls = $loader->getFilesAsXml(array('services1.xml'));
$t->is(count($xmls), 1, '->getFilesAsXml() returns an array of simple xml objects');
$t->is(key($xmls), realpath($fixturesPath . '/xml/services1.xml'), '->getFilesAsXml() returns an array where the keys are absolutes paths to the original XML file');
$t->is(get_class(current($xmls)), 'Symfony\\Components\\DependencyInjection\\SimpleXMLElement', '->getFilesAsXml() returns an array where values are SimpleXMLElement objects');
// ->load() # parameters
$t->diag('->load() # parameters');
$loader = new ProjectLoader($fixturesPath . '/xml');
$config = $loader->load(array('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');
$loader = new ProjectLoader($fixturesPath . '/xml');
$config = $loader->load(array('services2.xml', 'services3.xml'));