@@ -43,7 +43,7 @@ final class OutputFormatTest extends TestCase
43
43
*/
44
44
private $ oDocument ;
45
45
46
- protected function setUp ()
46
+ private function setUpTestcase ()
47
47
{
48
48
$ this ->oParser = new Parser (self ::TEST_CSS );
49
49
$ this ->oDocument = $ this ->oParser ->parse ();
@@ -54,6 +54,8 @@ protected function setUp()
54
54
*/
55
55
public function plain ()
56
56
{
57
+ $ this ->setUpTestcase ();
58
+
57
59
self ::assertSame (
58
60
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
59
61
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
@@ -66,6 +68,8 @@ public function plain()
66
68
*/
67
69
public function compact ()
68
70
{
71
+ $ this ->setUpTestcase ();
72
+
69
73
self ::assertSame (
70
74
'.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;} '
71
75
. '@media screen{.main{background-size:100% 100%;font-size:1.3em;background-color:#fff;}} ' ,
@@ -78,6 +82,8 @@ public function compact()
78
82
*/
79
83
public function pretty ()
80
84
{
85
+ $ this ->setUpTestcase ();
86
+
81
87
self ::assertSame (self ::TEST_CSS , $ this ->oDocument ->render (OutputFormat::createPretty ()));
82
88
}
83
89
@@ -86,6 +92,8 @@ public function pretty()
86
92
*/
87
93
public function spaceAfterListArgumentSeparator ()
88
94
{
95
+ $ this ->setUpTestcase ();
96
+
89
97
self ::assertSame (
90
98
'.main, .test {font: italic normal bold 16px/ 1.2 '
91
99
. '"Helvetica", Verdana, sans-serif;background: white;} '
@@ -99,6 +107,8 @@ public function spaceAfterListArgumentSeparator()
99
107
*/
100
108
public function spaceAfterListArgumentSeparatorComplex ()
101
109
{
110
+ $ this ->setUpTestcase ();
111
+
102
112
self ::assertSame (
103
113
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;} '
104
114
. "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} " ,
@@ -116,6 +126,8 @@ public function spaceAfterListArgumentSeparatorComplex()
116
126
*/
117
127
public function spaceAfterSelectorSeparator ()
118
128
{
129
+ $ this ->setUpTestcase ();
130
+
119
131
self ::assertSame (
120
132
'.main,
121
133
.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -129,6 +141,8 @@ public function spaceAfterSelectorSeparator()
129
141
*/
130
142
public function stringQuotingType ()
131
143
{
144
+ $ this ->setUpTestcase ();
145
+
132
146
self ::assertSame (
133
147
'.main, .test {font: italic normal bold 16px/1.2 \'Helvetica \',Verdana,sans-serif;background: white;}
134
148
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
@@ -141,6 +155,8 @@ public function stringQuotingType()
141
155
*/
142
156
public function rGBHashNotation ()
143
157
{
158
+ $ this ->setUpTestcase ();
159
+
144
160
self ::assertSame (
145
161
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
146
162
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: rgb(255,255,255);}} ' ,
@@ -153,6 +169,8 @@ public function rGBHashNotation()
153
169
*/
154
170
public function semicolonAfterLastRule ()
155
171
{
172
+ $ this ->setUpTestcase ();
173
+
156
174
self ::assertSame (
157
175
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
158
176
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff}} ' ,
@@ -165,6 +183,8 @@ public function semicolonAfterLastRule()
165
183
*/
166
184
public function spaceAfterRuleName ()
167
185
{
186
+ $ this ->setUpTestcase ();
187
+
168
188
self ::assertSame (
169
189
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
170
190
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
@@ -177,6 +197,8 @@ public function spaceAfterRuleName()
177
197
*/
178
198
public function spaceRules ()
179
199
{
200
+ $ this ->setUpTestcase ();
201
+
180
202
self ::assertSame ('.main, .test {
181
203
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
182
204
background: white;
@@ -193,6 +215,8 @@ public function spaceRules()
193
215
*/
194
216
public function spaceBlocks ()
195
217
{
218
+ $ this ->setUpTestcase ();
219
+
196
220
self ::assertSame ('
197
221
.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
198
222
@media screen {
@@ -206,6 +230,8 @@ public function spaceBlocks()
206
230
*/
207
231
public function spaceBoth ()
208
232
{
233
+ $ this ->setUpTestcase ();
234
+
209
235
self ::assertSame ('
210
236
.main, .test {
211
237
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
@@ -226,6 +252,8 @@ public function spaceBoth()
226
252
*/
227
253
public function spaceBetweenBlocks ()
228
254
{
255
+ $ this ->setUpTestcase ();
256
+
229
257
self ::assertSame (
230
258
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;} '
231
259
. '@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
@@ -238,6 +266,8 @@ public function spaceBetweenBlocks()
238
266
*/
239
267
public function indentation ()
240
268
{
269
+ $ this ->setUpTestcase ();
270
+
241
271
self ::assertSame ('
242
272
.main, .test {
243
273
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
@@ -261,6 +291,8 @@ public function indentation()
261
291
*/
262
292
public function spaceBeforeBraces ()
263
293
{
294
+ $ this ->setUpTestcase ();
295
+
264
296
self ::assertSame (
265
297
'.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
266
298
@media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
@@ -273,6 +305,8 @@ public function spaceBeforeBraces()
273
305
*/
274
306
public function ignoreExceptionsOff ()
275
307
{
308
+ $ this ->setUpTestcase ();
309
+
276
310
$ this ->expectException (OutputException::class);
277
311
278
312
$ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
@@ -292,6 +326,8 @@ public function ignoreExceptionsOff()
292
326
*/
293
327
public function ignoreExceptionsOn ()
294
328
{
329
+ $ this ->setUpTestcase ();
330
+
295
331
$ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
296
332
$ oFirstBlock = $ aBlocks [0 ];
297
333
$ oFirstBlock ->removeSelector ('.main ' );
0 commit comments