public function XmlFileLoaderTest::testLoadParameters

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php, line 87

Class

XmlFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testLoadParameters() {
  $container = new ContainerBuilder();
  $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath . '/xml'));
  $loader
    ->load('services2.xml');
  $actual = $container
    ->getParameterBag()
    ->all();
  $expected = 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'),
    'mixedcase' => array(
      'MixedCaseKey' => 'value',
    ),
  );
  $this
    ->assertEquals($expected, $actual, '->load() converts XML values to PHP ones');
}