Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / config / Tests / Definition / Dumper / YamlReferenceDumperTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Config\Tests\Definition\Dumper;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
16 use Symfony\Component\Config\Tests\Fixtures\Configuration\ExampleConfiguration;
17
18 class YamlReferenceDumperTest extends TestCase
19 {
20     public function testDumper()
21     {
22         $configuration = new ExampleConfiguration();
23
24         $dumper = new YamlReferenceDumper();
25
26         $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
27     }
28
29     private function getConfigurationAsString()
30     {
31         return <<<'EOL'
32 acme_root:
33     boolean:              true
34     scalar_empty:         ~
35     scalar_null:          null
36     scalar_true:          true
37     scalar_false:         false
38     scalar_default:       default
39     scalar_array_empty:   []
40     scalar_array_defaults:
41
42         # Defaults:
43         - elem1
44         - elem2
45     scalar_required:      ~ # Required
46     node_with_a_looong_name: ~
47     enum_with_default:    this # One of "this"; "that"
48     enum:                 ~ # One of "this"; "that"
49
50     # some info
51     array:
52         child1:               ~
53         child2:               ~
54
55         # this is a long
56         # multi-line info text
57         # which should be indented
58         child3:               ~ # Example: example setting
59     scalar_prototyped:    []
60     parameters:
61
62         # Prototype: Parameter name
63         name:                 ~
64     connections:
65
66         # Prototype
67         -
68             user:                 ~
69             pass:                 ~
70     cms_pages:
71
72         # Prototype
73         page:
74
75             # Prototype
76             locale:
77                 title:                ~ # Required
78                 path:                 ~ # Required
79     pipou:
80
81         # Prototype
82         name:                 []
83
84 EOL;
85     }
86 }