Skip to content

Commit

Permalink
fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed May 31, 2018
1 parent 3e49f35 commit 242aada
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/Tests/DependencyInjection/HandlebarsExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ public function testLoad()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand Down Expand Up @@ -93,10 +94,12 @@ public function testAssetic()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->addResource(new FileResource($bundleDir . '/Resources/config/assetic.xml'))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand All @@ -111,7 +114,6 @@ public function testAssetic()
$container->setParameter("handlebars.translation.interpolation_suffix", '%')->shouldBeCalled();
$container->getParameter('kernel.bundles')->willReturn([])->shouldBeCalled();
$container->setParameter('handlebars.assetic', true)->shouldBeCalled();
$container->addResource(new FileResource($bundleDir . '/Resources/config/assetic.xml'))->shouldBeCalled();

$container->getDefinition("handlebars.loader.filesystem")
->willReturn($loaderDefinition->reveal())->shouldBeCalled();
Expand Down Expand Up @@ -149,10 +151,11 @@ public function testBundlePaths()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand Down Expand Up @@ -207,10 +210,11 @@ public function testAddConfigPath()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand Down Expand Up @@ -262,10 +266,11 @@ public function testFlags()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand Down Expand Up @@ -328,10 +333,11 @@ public function testExcludeFlags()

if (in_array('fileExists', get_class_methods('Symfony\Component\DependencyInjection\ContainerBuilder'))) {
$container->fileExists(Argument::any())->willReturn(true);
} else {
$container->addResource(Argument::which('getResource', realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
}
$container->getParameterBag()->willReturn($parameterBag->reveal());
$container->hasExtension(Argument::any())->willReturn(false);
$container->addResource(new FileResource(realpath(__DIR__ . '/../../Resources/config/handlebars.xml')))->shouldBeCalled();
$container->setDefinition(
Argument::type('string'),
Argument::type('Symfony\Component\DependencyInjection\Definition')
Expand Down

0 comments on commit 242aada

Please sign in to comment.