ZF-11934: Zend_Config_Yaml should strip quotes in values

Description

 
one: 'two'

will result


array('one' => "'two'")

Comments

Added patch with fix and tests

Your patch appears to include the tests for your fix to ZF-11363.

Confirmed. Test:



Index: tests/Zend/Config/YamlTest.php
===================================================================
--- tests/Zend/Config/YamlTest.php      (revision 24628)
+++ tests/Zend/Config/YamlTest.php      (working copy)
@@ -50,6 +50,7 @@
         $this->_yamlIndentedCommentsConfig  = dirname(__FILE__) . '/_files/indentedcomments.yaml';
         $this->_yamlListConstantsConfig     = dirname(__FILE__) . '/_files/listconstants.yaml';
         $this->_listBooleansConfig          = dirname(__FILE__) . '/_files/listbooleans.yaml';
+        $this->_yamlSingleQuotedString    = dirname(__FILE__) . '/_files/zf11934.yaml';
     }

     public function testLoadSingleSection()
@@ -406,4 +407,13 @@
         $this->assertFalse($config->usingCapitalOff->{0});
     }

+    /**
+     * @group ZF-11934
+     */
+    public function testAllowsSingleQuotedStringValues()
+    {
+        $config = new Zend_Config_Yaml($this->_yamlSingleQuotedString);
+        $this->assertEquals('two', $config->one);
+    }
+
 }

Result:



1) Zend_Config_YamlTest::testAllowsSingleQuotedStringValues
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-two
+'two'

After applying the fix supplied in your patch, this unit test (and all others in Zend_Config_Yaml) pass.

Attached my version of OP's patch: ZF-11934_adamlundrigan.patch

Applied modified patch from Adam Lundrigan in r24712.

Set to next Minor release rather than mini to note the fact that this is a BC break (even though very small)