Преглед изворни кода

[1.11] Better test for injecting YAML parser

- Modified test of passing options to constructor to better detect that a parser
  was passed.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23106 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew пре 15 година
родитељ
комит
74808c1d92
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      tests/Zend/Config/YamlTest.php

+ 7 - 1
tests/Zend/Config/YamlTest.php

@@ -219,17 +219,23 @@ class Zend_Config_YamlTest extends PHPUnit_Framework_TestCase
         $this->assertEquals('3', $config->six->seven->{2}->nine);
     }
 
+    public function yamlDecoder($string)
+    {
+        return Zend_Config_Yaml::decode($string);
+    }
+
     public function testHonorsOptionsProvidedToConstructor()
     {
         $config = new Zend_Config_Yaml($this->_iniFileAllSectionsConfig, 'debug', array(
             'allow_modifications' => true,
             'skip_extends'        => true,
-            'yaml_decoder'        => array('Zend_Config_Yaml', 'decode'),
+            'yaml_decoder'        => array($this, 'yamlDecoder'),
             'foo'                 => 'bar', // ignored
         ));
         $this->assertNull($config->name); // verifies extends were skipped
         $config->foo = 'bar';
         $this->assertEquals('bar', $config->foo); // verifies allows modifications
+        $this->assertEquals(array($this, 'yamlDecoder'), $config->getYamlDecoder());
     }
 
     public function testConstructorRaisesExceptionWhenUnableToLoadFile()