$this->assertInstanceOf('\InvalidArgumentException',$e,'->load() throws an InvalidArgumentException if the loaded file does not exist');
$this->assertStringStartsWith('The file "foo.xml" does not exist (in:',$e->getMessage(),'->load() throws an InvalidArgumentException if the loaded file does not exist');
$this->assertInstanceOf('\InvalidArgumentException',$e,'->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
$this->assertStringStartsWith('[ERROR 4] Start tag expected, \'<\' not found (in',$e->getMessage(),'->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
$this->assertInstanceOf('\InvalidArgumentException',$e,'->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD');
$this->assertStringStartsWith('[ERROR 1845] Element \'nonvalid\': No matching global declaration available for the validation root. (in',$e->getMessage(),'->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD');
$this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference',get_class($args[0]),'->load() converts anonymous services to references to "normal" services');
$this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference',get_class($args[0]),'->load() converts anonymous services to references to "normal" services');
$this->assertEquals('Symfony\\Component\\DependencyInjection\\Definition',get_class($services['foo']),'->load() converts <service> element to Definition instances');
$this->assertEquals('%path%/foo.php',$services['file']->getFile(),'->load() parses the file tag');
$this->assertEquals(array('foo',newReference('foo'),array(true,false)),$services['arguments']->getArguments(),'->load() parses the argument tags');
$this->assertEquals('sc_configure',$services['configurator1']->getConfigurator(),'->load() parses the configurator tag');
$this->assertEquals(array(newReference('baz'),'configure'),$services['configurator2']->getConfigurator(),'->load() parses the configurator tag');
$this->assertEquals(array('BazClass','configureStatic'),$services['configurator3']->getConfigurator(),'->load() parses the configurator tag');
$this->assertEquals(array(array('setBar',array())),$services['method_call1']->getMethodCalls(),'->load() parses the method_call tag');
$this->assertEquals(array(array('setBar',array('foo',newReference('foo'),array(true,false)))),$services['method_call2']->getMethodCalls(),'->load() parses the method_call tag');
$this->assertEquals('bar',ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$doc=new\DOMDocument("1.0");
$doc->loadXML('<foo foo="bar" />');
$this->assertEquals(array('foo'=>'bar'),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$doc=new\DOMDocument("1.0");
$doc->loadXML('<foo><foo>bar</foo></foo>');
$this->assertEquals(array('foo'=>'bar'),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$this->assertEquals(array('foo'=>array('value'=>'bar','foo'=>'bar')),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$doc=new\DOMDocument("1.0");
$doc->loadXML('<foo><foo></foo></foo>');
$this->assertEquals(array('foo'=>null),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$this->assertEquals(array('foo'=>null),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$this->assertEquals(array('foo'=>array(array('foo'=>'bar'),array('foo'=>'bar'))),ProjectLoader2::convertDomElementToArray($doc->documentElement),'::convertDomElementToArray() converts a \DomElement to an array');
$this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
}catch(\Exception$e){
$this->assertInstanceOf('\InvalidArgumentException',$e,'->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
$this->assertRegexp('/The attribute \'bar\' is not allowed/',$e->getMessage(),'->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
$this->assertStringStartsWith('There is no extension able to load the configuration for "project:bar" (in',$e->getMessage(),'->load() throws an InvalidArgumentException if the tag is not valid');
// extension with an XSD in PHAR archive (does not validate)
try{
$loader->load('extensions/services7.xml');
$this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
}catch(\Exception$e){
$this->assertInstanceOf('\InvalidArgumentException',$e,'->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
$this->assertRegexp('/The attribute \'bar\' is not allowed/',$e->getMessage(),'->load() throws an InvalidArgumentException if the configuration does not validate the XSD');