Fix travis build
This commit is contained in:
parent
db4230ef8c
commit
099e480c1c
@ -302,7 +302,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
|
||||
|
||||
$this->assertCount(6, $calls);
|
||||
$this->assertSame('enableAnnotations', $calls[4][0]);
|
||||
$this->assertSame('enableAnnotationMapping', $calls[4][0]);
|
||||
$this->assertEquals(array(new Reference('annotation_reader')), $calls[4][1]);
|
||||
$this->assertSame('addMethodMapping', $calls[5][0]);
|
||||
$this->assertSame(array('loadClassMetadata'), $calls[5][1]);
|
||||
@ -322,7 +322,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertCount(7, $calls);
|
||||
$this->assertSame('addXmlMappings', $calls[3][0]);
|
||||
$this->assertSame('addYamlMappings', $calls[4][0]);
|
||||
$this->assertSame('enableAnnotations', $calls[5][0]);
|
||||
$this->assertSame('enableAnnotationMapping', $calls[5][0]);
|
||||
$this->assertSame('addMethodMapping', $calls[6][0]);
|
||||
$this->assertSame(array('loadClassMetadata'), $calls[6][1]);
|
||||
|
||||
|
@ -102,6 +102,8 @@ class QuestionHelper extends Helper
|
||||
/**
|
||||
* Asks the question to the user.
|
||||
*
|
||||
* This method is public for PHP 5.3 compatibility, it should be private.
|
||||
*
|
||||
* @param OutputInterface $output
|
||||
* @param Question $question
|
||||
*
|
||||
@ -110,7 +112,7 @@ class QuestionHelper extends Helper
|
||||
* @throws \Exception
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
private function doAsk(OutputInterface $output, Question $question)
|
||||
public function doAsk(OutputInterface $output, Question $question)
|
||||
{
|
||||
$message = $question->getQuestion();
|
||||
if ($question instanceof ChoiceQuestion) {
|
||||
|
@ -53,37 +53,37 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini'));
|
||||
$r = new \ReflectionObject($loader);
|
||||
$m = $r->getMethod('parseFile');
|
||||
$m = $r->getMethod('parseFileToDOM');
|
||||
$m->setAccessible(true);
|
||||
|
||||
try {
|
||||
$m->invoke($loader, self::$fixturesPath.'/ini/parameters.ini');
|
||||
$this->fail('->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
$this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
$this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'parameters.ini'), $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
$this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'parameters.ini'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
|
||||
$e = $e->getPrevious();
|
||||
$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, '->parseFileToDOM() 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(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
}
|
||||
|
||||
$loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/xml'));
|
||||
|
||||
try {
|
||||
$m->invoke($loader, self::$fixturesPath.'/xml/nonvalid.xml');
|
||||
$this->fail('->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD');
|
||||
$this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD');
|
||||
$this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'nonvalid.xml'), $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
|
||||
$this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'nonvalid.xml'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
|
||||
|
||||
$e = $e->getPrevious();
|
||||
$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->assertInstanceOf('InvalidArgumentException', $e, '->parseFileToDOM() 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(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
|
||||
}
|
||||
|
||||
$xml = $m->invoke($loader, self::$fixturesPath.'/xml/services1.xml');
|
||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', $xml, '->parseFile() returns an SimpleXMLElement object');
|
||||
$this->assertInstanceOf('DOMDocument', $xml, '->parseFileToDOM() returns an SimpleXMLElement object');
|
||||
}
|
||||
|
||||
public function testLoadParameters()
|
||||
|
Reference in New Issue
Block a user