You are here

public function ExtensionTest::testIsConfigEnabledReturnsTheResolvedValue in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php \Symfony\Component\DependencyInjection\Tests\Extension\ExtensionTest::testIsConfigEnabledReturnsTheResolvedValue()

@dataProvider getResolvedEnabledFixtures

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php, line 19

Class

ExtensionTest

Namespace

Symfony\Component\DependencyInjection\Tests\Extension

Code

public function testIsConfigEnabledReturnsTheResolvedValue($enabled) {
  $pb = $this
    ->getMockBuilder('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag')
    ->setMethods(array(
    'resolveValue',
  ))
    ->getMock();
  $container = $this
    ->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')
    ->setMethods(array(
    'getParameterBag',
  ))
    ->getMock();
  $pb
    ->expects($this
    ->once())
    ->method('resolveValue')
    ->with($this
    ->equalTo($enabled))
    ->will($this
    ->returnValue($enabled));
  $container
    ->expects($this
    ->once())
    ->method('getParameterBag')
    ->will($this
    ->returnValue($pb));
  $extension = $this
    ->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\Extension')
    ->setMethods(array())
    ->getMockForAbstractClass();
  $r = new \ReflectionMethod('Symfony\\Component\\DependencyInjection\\Extension\\Extension', 'isConfigEnabled');
  $r
    ->setAccessible(true);
  $r
    ->invoke($extension, $container, array(
    'enabled' => $enabled,
  ));
}