瀏覽代碼

[DepedencyInjection] fixed unit tests

Fabien Potencier 13 年之前
父節點
當前提交
b8e5a155e4

+ 5 - 0
tests/Symfony/Tests/Component/DependencyInjection/Fixtures/ini/array.ini

@@ -0,0 +1,5 @@
+[parameters]
+  foo = bar
+  versions[] = "1"
+  versions[] = "2"
+  versions[] = "3"

+ 0 - 3
tests/Symfony/Tests/Component/DependencyInjection/Fixtures/ini/parameters.ini

@@ -1,6 +1,3 @@
 [parameters]
   foo = bar
   bar = %foo%
-  versions[] = "1"
-  versions[] = "2"
-  versions[] = "3"

+ 6 - 1
tests/Symfony/Tests/Component/DependencyInjection/Loader/IniFileLoaderTest.php

@@ -33,7 +33,12 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
         $container = new ContainerBuilder();
         $loader = new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini'));
         $loader->load('parameters.ini');
-        $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%', 'versions' => array(1, 2, 3)), $container->getParameterBag()->all(), '->load() takes a single file name as its first argument');
+        $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%'), $container->getParameterBag()->all(), '->load() takes a single file name as its first argument');
+
+        $container = new ContainerBuilder();
+        $loader = new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini'));
+        $loader->load('array.ini');
+        $this->assertEquals(array('foo' => 'bar', 'versions' => array(1, 2, 3)), $container->getParameterBag()->all(), '->load() takes a single file name as its first argument');
 
         $container = new ContainerBuilder();
         $loader = new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini'));