Added the Search API Synonym module to deal specifically with licence and license...
[yaffs-website] / vendor / symfony / config / Tests / Definition / Dumper / YamlReferenceDumperTest.php
index 9dda4155492cc7cbaea55c5c2aad4bee1864e9fe..bf4db95f4154330dc04a0a6a55269726193230f1 100644 (file)
@@ -23,8 +23,62 @@ class YamlReferenceDumperTest extends TestCase
 
         $dumper = new YamlReferenceDumper();
 
-        $this->assertContains($this->getConfigurationAsString(), $dumper->dump($configuration));
-        $this->markTestIncomplete('The Yaml Dumper currently does not support prototyped arrays');
+        $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
+    }
+
+    public function provideDumpAtPath()
+    {
+        return array(
+            'Regular node' => array('scalar_true', <<<EOL
+scalar_true:          true
+EOL
+            ),
+            'Array node' => array('array', <<<EOL
+# some info
+array:
+    child1:               ~
+    child2:               ~
+
+    # this is a long
+    # multi-line info text
+    # which should be indented
+    child3:               ~ # Example: example setting
+EOL
+            ),
+            'Regular nested' => array('array.child2', <<<EOL
+child2:               ~
+EOL
+            ),
+            'Prototype' => array('cms_pages.page', <<<EOL
+# Prototype
+page:
+
+    # Prototype
+    locale:
+        title:                ~ # Required
+        path:                 ~ # Required
+EOL
+            ),
+            'Nested prototype' => array('cms_pages.page.locale', <<<EOL
+# Prototype
+locale:
+    title:                ~ # Required
+    path:                 ~ # Required
+EOL
+            ),
+        );
+    }
+
+    /**
+     * @dataProvider provideDumpAtPath
+     */
+    public function testDumpAtPath($path, $expected)
+    {
+        $configuration = new ExampleConfiguration();
+
+        $dumper = new YamlReferenceDumper();
+
+        $this->assertSame(trim($expected), trim($dumper->dumpAtPath($configuration, $path)));
     }
 
     private function getConfigurationAsString()
@@ -44,6 +98,8 @@ acme_root:
         - elem1
         - elem2
     scalar_required:      ~ # Required
+    scalar_deprecated:    ~ # Deprecated (The child node "scalar_deprecated" at path "acme_root" is deprecated.)
+    scalar_deprecated_with_message: ~ # Deprecated (Deprecation custom message for "scalar_deprecated_with_message" at "acme_root")
     node_with_a_looong_name: ~
     enum_with_default:    this # One of "this"; "that"
     enum:                 ~ # One of "this"; "that"
@@ -57,10 +113,31 @@ acme_root:
         # multi-line info text
         # which should be indented
         child3:               ~ # Example: example setting
+    scalar_prototyped:    []
     parameters:
 
         # Prototype: Parameter name
         name:                 ~
+    connections:
+
+        # Prototype
+        -
+            user:                 ~
+            pass:                 ~
+    cms_pages:
+
+        # Prototype
+        page:
+
+            # Prototype
+            locale:
+                title:                ~ # Required
+                path:                 ~ # Required
+    pipou:
+
+        # Prototype
+        name:                 []
+
 EOL;
     }
 }