You are here

public function XmlFileLoaderTest::testLoadParameters in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\XmlFileLoaderTest::testLoadParameters()

File

vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php, line 86

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',
      ),
    ),
    'mixedcase' => array(
      'MixedCaseKey' => 'value',
    ),
    'constant' => PHP_EOL,
  );
  $this
    ->assertEquals($expected, $actual, '->load() converts XML values to PHP ones');
}