Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Application modulaire fonctionnelle !

Emmanuel ROY authored on 12/08/2019 15:10:25
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,74 +0,0 @@
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\Translation\Tests\Util;
13
-
14
-use PHPUnit\Framework\TestCase;
15
-use Symfony\Component\Translation\Util\ArrayConverter;
16
-
17
-class ArrayConverterTest extends TestCase
18
-{
19
-    /**
20
-     * @dataProvider messagesData
21
-     */
22
-    public function testDump($input, $expectedOutput)
23
-    {
24
-        $this->assertEquals($expectedOutput, ArrayConverter::expandToTree($input));
25
-    }
26
-
27
-    public function messagesData()
28
-    {
29
-        return [
30
-            [
31
-                // input
32
-                [
33
-                    'foo1' => 'bar',
34
-                    'foo.bar' => 'value',
35
-                ],
36
-                // expected output
37
-                [
38
-                    'foo1' => 'bar',
39
-                    'foo' => ['bar' => 'value'],
40
-                ],
41
-            ],
42
-            [
43
-                // input
44
-                [
45
-                    'foo.bar' => 'value1',
46
-                    'foo.bar.test' => 'value2',
47
-                ],
48
-                // expected output
49
-                [
50
-                    'foo' => [
51
-                        'bar' => 'value1',
52
-                        'bar.test' => 'value2',
53
-                    ],
54
-                ],
55
-            ],
56
-            [
57
-                // input
58
-                [
59
-                    'foo.level2.level3.level4' => 'value1',
60
-                    'foo.level2' => 'value2',
61
-                    'foo.bar' => 'value3',
62
-                ],
63
-                // expected output
64
-                [
65
-                    'foo' => [
66
-                        'level2' => 'value2',
67
-                        'level2.level3.level4' => 'value1',
68
-                        'bar' => 'value3',
69
-                    ],
70
-                ],
71
-            ],
72
-        ];
73
-    }
74
-}
Browse code

initial commit

Emmanuel ROY authored on 09/08/2019 08:39:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,74 @@
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\Translation\Tests\Util;
13
+
14
+use PHPUnit\Framework\TestCase;
15
+use Symfony\Component\Translation\Util\ArrayConverter;
16
+
17
+class ArrayConverterTest extends TestCase
18
+{
19
+    /**
20
+     * @dataProvider messagesData
21
+     */
22
+    public function testDump($input, $expectedOutput)
23
+    {
24
+        $this->assertEquals($expectedOutput, ArrayConverter::expandToTree($input));
25
+    }
26
+
27
+    public function messagesData()
28
+    {
29
+        return [
30
+            [
31
+                // input
32
+                [
33
+                    'foo1' => 'bar',
34
+                    'foo.bar' => 'value',
35
+                ],
36
+                // expected output
37
+                [
38
+                    'foo1' => 'bar',
39
+                    'foo' => ['bar' => 'value'],
40
+                ],
41
+            ],
42
+            [
43
+                // input
44
+                [
45
+                    'foo.bar' => 'value1',
46
+                    'foo.bar.test' => 'value2',
47
+                ],
48
+                // expected output
49
+                [
50
+                    'foo' => [
51
+                        'bar' => 'value1',
52
+                        'bar.test' => 'value2',
53
+                    ],
54
+                ],
55
+            ],
56
+            [
57
+                // input
58
+                [
59
+                    'foo.level2.level3.level4' => 'value1',
60
+                    'foo.level2' => 'value2',
61
+                    'foo.bar' => 'value3',
62
+                ],
63
+                // expected output
64
+                [
65
+                    'foo' => [
66
+                        'level2' => 'value2',
67
+                        'level2.level3.level4' => 'value1',
68
+                        'bar' => 'value3',
69
+                    ],
70
+                ],
71
+            ],
72
+        ];
73
+    }
74
+}