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,196 +0,0 @@
1
-<?php declare(strict_types=1);
2
-/**
3
- * Part of Windwalker project Test files.  @codingStandardsIgnoreStart
4
- *
5
- * @copyright  Copyright (C) 2019 LYRASOFT Taiwan, Inc.
6
- * @license    LGPL-2.0-or-later
7
- */
8
-
9
-namespace Windwalker\Renderer\Test\Twig;
10
-
11
-use Windwalker\Dom\Test\AbstractDomTestCase;
12
-use Windwalker\Renderer\Test\Stub\StubTwigExtension;
13
-use Windwalker\Renderer\Twig\GlobalContainer;
14
-use Windwalker\Renderer\TwigRenderer;
15
-
16
-/**
17
- * Test class of GlobalContainer
18
- *
19
- * @since 2.0
20
- */
21
-class GlobalContainerTest extends AbstractDomTestCase
22
-{
23
-    /**
24
-     * Method to test addExtension().
25
-     *
26
-     * @return void
27
-     *
28
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::addExtension
29
-     */
30
-    public function testAddExtension()
31
-    {
32
-        GlobalContainer::addExtension('stub', new StubTwigExtension());
33
-
34
-        $renderer = new TwigRenderer(__DIR__ . '/../Tmpl/twig');
35
-
36
-        $html = $renderer->render('ext-test.twig');
37
-
38
-        $expect = <<<HTML
39
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
40
-<p>Suspendisse finibus fermentum massa ut tempus. Sed in pulvinar dolor.</p>
41
-<ul>
42
-    <li>peace</li>
43
-    <li>sakura</li>
44
-    <li>Iron Man</li>
45
-</ul>
46
-HTML;
47
-
48
-        $this->assertHtmlFormatEquals($expect, $html);
49
-
50
-        GlobalContainer::removeExtension('stub');
51
-    }
52
-
53
-    /**
54
-     * Method to test getExtension().
55
-     *
56
-     * @return void
57
-     *
58
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getExtension
59
-     * @TODO   Implement testGetExtension().
60
-     */
61
-    public function testGetExtension()
62
-    {
63
-        // Remove the following lines when you implement this test.
64
-        $this->markTestIncomplete(
65
-            'This test has not been implemented yet.'
66
-        );
67
-    }
68
-
69
-    /**
70
-     * Method to test removeExtension().
71
-     *
72
-     * @return void
73
-     *
74
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::removeExtension
75
-     * @TODO   Implement testRemoveExtension().
76
-     */
77
-    public function testRemoveExtension()
78
-    {
79
-        // Remove the following lines when you implement this test.
80
-        $this->markTestIncomplete(
81
-            'This test has not been implemented yet.'
82
-        );
83
-    }
84
-
85
-    /**
86
-     * Method to test getExtensions().
87
-     *
88
-     * @return void
89
-     *
90
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getExtensions
91
-     * @TODO   Implement testGetExtensions().
92
-     */
93
-    public function testGetExtensions()
94
-    {
95
-        // Remove the following lines when you implement this test.
96
-        $this->markTestIncomplete(
97
-            'This test has not been implemented yet.'
98
-        );
99
-    }
100
-
101
-    /**
102
-     * Method to test setExtensions().
103
-     *
104
-     * @return void
105
-     *
106
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::setExtensions
107
-     * @TODO   Implement testSetExtensions().
108
-     */
109
-    public function testSetExtensions()
110
-    {
111
-        // Remove the following lines when you implement this test.
112
-        $this->markTestIncomplete(
113
-            'This test has not been implemented yet.'
114
-        );
115
-    }
116
-
117
-    /**
118
-     * Method to test addGlobal().
119
-     *
120
-     * @return void
121
-     *
122
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::addGlobal
123
-     * @TODO   Implement testAddGlobal().
124
-     */
125
-    public function testAddGlobal()
126
-    {
127
-        // Remove the following lines when you implement this test.
128
-        $this->markTestIncomplete(
129
-            'This test has not been implemented yet.'
130
-        );
131
-    }
132
-
133
-    /**
134
-     * Method to test getGlobal().
135
-     *
136
-     * @return void
137
-     *
138
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getGlobal
139
-     * @TODO   Implement testGetGlobal().
140
-     */
141
-    public function testGetGlobal()
142
-    {
143
-        // Remove the following lines when you implement this test.
144
-        $this->markTestIncomplete(
145
-            'This test has not been implemented yet.'
146
-        );
147
-    }
148
-
149
-    /**
150
-     * Method to test removeGlobal().
151
-     *
152
-     * @return void
153
-     *
154
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::removeGlobal
155
-     * @TODO   Implement testRemoveGlobal().
156
-     */
157
-    public function testRemoveGlobal()
158
-    {
159
-        // Remove the following lines when you implement this test.
160
-        $this->markTestIncomplete(
161
-            'This test has not been implemented yet.'
162
-        );
163
-    }
164
-
165
-    /**
166
-     * Method to test getGlobals().
167
-     *
168
-     * @return void
169
-     *
170
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getGlobals
171
-     * @TODO   Implement testGetGlobals().
172
-     */
173
-    public function testGetGlobals()
174
-    {
175
-        // Remove the following lines when you implement this test.
176
-        $this->markTestIncomplete(
177
-            'This test has not been implemented yet.'
178
-        );
179
-    }
180
-
181
-    /**
182
-     * Method to test setGlobals().
183
-     *
184
-     * @return void
185
-     *
186
-     * @covers \Windwalker\Renderer\Twig\GlobalContainer::setGlobals
187
-     * @TODO   Implement testSetGlobals().
188
-     */
189
-    public function testSetGlobals()
190
-    {
191
-        // Remove the following lines when you implement this test.
192
-        $this->markTestIncomplete(
193
-            'This test has not been implemented yet.'
194
-        );
195
-    }
196
-}
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,196 @@
1
+<?php declare(strict_types=1);
2
+/**
3
+ * Part of Windwalker project Test files.  @codingStandardsIgnoreStart
4
+ *
5
+ * @copyright  Copyright (C) 2019 LYRASOFT Taiwan, Inc.
6
+ * @license    LGPL-2.0-or-later
7
+ */
8
+
9
+namespace Windwalker\Renderer\Test\Twig;
10
+
11
+use Windwalker\Dom\Test\AbstractDomTestCase;
12
+use Windwalker\Renderer\Test\Stub\StubTwigExtension;
13
+use Windwalker\Renderer\Twig\GlobalContainer;
14
+use Windwalker\Renderer\TwigRenderer;
15
+
16
+/**
17
+ * Test class of GlobalContainer
18
+ *
19
+ * @since 2.0
20
+ */
21
+class GlobalContainerTest extends AbstractDomTestCase
22
+{
23
+    /**
24
+     * Method to test addExtension().
25
+     *
26
+     * @return void
27
+     *
28
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::addExtension
29
+     */
30
+    public function testAddExtension()
31
+    {
32
+        GlobalContainer::addExtension('stub', new StubTwigExtension());
33
+
34
+        $renderer = new TwigRenderer(__DIR__ . '/../Tmpl/twig');
35
+
36
+        $html = $renderer->render('ext-test.twig');
37
+
38
+        $expect = <<<HTML
39
+<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
40
+<p>Suspendisse finibus fermentum massa ut tempus. Sed in pulvinar dolor.</p>
41
+<ul>
42
+    <li>peace</li>
43
+    <li>sakura</li>
44
+    <li>Iron Man</li>
45
+</ul>
46
+HTML;
47
+
48
+        $this->assertHtmlFormatEquals($expect, $html);
49
+
50
+        GlobalContainer::removeExtension('stub');
51
+    }
52
+
53
+    /**
54
+     * Method to test getExtension().
55
+     *
56
+     * @return void
57
+     *
58
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getExtension
59
+     * @TODO   Implement testGetExtension().
60
+     */
61
+    public function testGetExtension()
62
+    {
63
+        // Remove the following lines when you implement this test.
64
+        $this->markTestIncomplete(
65
+            'This test has not been implemented yet.'
66
+        );
67
+    }
68
+
69
+    /**
70
+     * Method to test removeExtension().
71
+     *
72
+     * @return void
73
+     *
74
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::removeExtension
75
+     * @TODO   Implement testRemoveExtension().
76
+     */
77
+    public function testRemoveExtension()
78
+    {
79
+        // Remove the following lines when you implement this test.
80
+        $this->markTestIncomplete(
81
+            'This test has not been implemented yet.'
82
+        );
83
+    }
84
+
85
+    /**
86
+     * Method to test getExtensions().
87
+     *
88
+     * @return void
89
+     *
90
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getExtensions
91
+     * @TODO   Implement testGetExtensions().
92
+     */
93
+    public function testGetExtensions()
94
+    {
95
+        // Remove the following lines when you implement this test.
96
+        $this->markTestIncomplete(
97
+            'This test has not been implemented yet.'
98
+        );
99
+    }
100
+
101
+    /**
102
+     * Method to test setExtensions().
103
+     *
104
+     * @return void
105
+     *
106
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::setExtensions
107
+     * @TODO   Implement testSetExtensions().
108
+     */
109
+    public function testSetExtensions()
110
+    {
111
+        // Remove the following lines when you implement this test.
112
+        $this->markTestIncomplete(
113
+            'This test has not been implemented yet.'
114
+        );
115
+    }
116
+
117
+    /**
118
+     * Method to test addGlobal().
119
+     *
120
+     * @return void
121
+     *
122
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::addGlobal
123
+     * @TODO   Implement testAddGlobal().
124
+     */
125
+    public function testAddGlobal()
126
+    {
127
+        // Remove the following lines when you implement this test.
128
+        $this->markTestIncomplete(
129
+            'This test has not been implemented yet.'
130
+        );
131
+    }
132
+
133
+    /**
134
+     * Method to test getGlobal().
135
+     *
136
+     * @return void
137
+     *
138
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getGlobal
139
+     * @TODO   Implement testGetGlobal().
140
+     */
141
+    public function testGetGlobal()
142
+    {
143
+        // Remove the following lines when you implement this test.
144
+        $this->markTestIncomplete(
145
+            'This test has not been implemented yet.'
146
+        );
147
+    }
148
+
149
+    /**
150
+     * Method to test removeGlobal().
151
+     *
152
+     * @return void
153
+     *
154
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::removeGlobal
155
+     * @TODO   Implement testRemoveGlobal().
156
+     */
157
+    public function testRemoveGlobal()
158
+    {
159
+        // Remove the following lines when you implement this test.
160
+        $this->markTestIncomplete(
161
+            'This test has not been implemented yet.'
162
+        );
163
+    }
164
+
165
+    /**
166
+     * Method to test getGlobals().
167
+     *
168
+     * @return void
169
+     *
170
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::getGlobals
171
+     * @TODO   Implement testGetGlobals().
172
+     */
173
+    public function testGetGlobals()
174
+    {
175
+        // Remove the following lines when you implement this test.
176
+        $this->markTestIncomplete(
177
+            'This test has not been implemented yet.'
178
+        );
179
+    }
180
+
181
+    /**
182
+     * Method to test setGlobals().
183
+     *
184
+     * @return void
185
+     *
186
+     * @covers \Windwalker\Renderer\Twig\GlobalContainer::setGlobals
187
+     * @TODO   Implement testSetGlobals().
188
+     */
189
+    public function testSetGlobals()
190
+    {
191
+        // Remove the following lines when you implement this test.
192
+        $this->markTestIncomplete(
193
+            'This test has not been implemented yet.'
194
+        );
195
+    }
196
+}