@@ -41,42 +41,57 @@ protected function setUp()
41
41
$ this ->oDocument = $ this ->oParser ->parse ();
42
42
}
43
43
44
- public function testPlain ()
44
+ /**
45
+ * @test
46
+ */
47
+ public function plain ()
45
48
{
46
- $ this -> assertSame (
49
+ self :: assertSame (
47
50
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
48
51
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
49
52
$ this ->oDocument ->render ()
50
53
);
51
54
}
52
55
53
- public function testCompact ()
56
+ /**
57
+ * @test
58
+ */
59
+ public function compact ()
54
60
{
55
- $ this -> assertSame (
61
+ self :: assertSame (
56
62
'.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;} '
57
63
. '@media screen{.main{background-size:100% 100%;font-size:1.3em;background-color:#fff;}} ' ,
58
64
$ this ->oDocument ->render (OutputFormat::createCompact ())
59
65
);
60
66
}
61
67
62
- public function testPretty ()
68
+ /**
69
+ * @test
70
+ */
71
+ public function pretty ()
63
72
{
64
- $ this -> assertSame (self ::TEST_CSS , $ this ->oDocument ->render (OutputFormat::createPretty ()));
73
+ self :: assertSame (self ::TEST_CSS , $ this ->oDocument ->render (OutputFormat::createPretty ()));
65
74
}
66
75
67
- public function testSpaceAfterListArgumentSeparator ()
76
+ /**
77
+ * @test
78
+ */
79
+ public function spaceAfterListArgumentSeparator ()
68
80
{
69
- $ this -> assertSame (
81
+ self :: assertSame (
70
82
'.main, .test {font: italic normal bold 16px/ 1.2 '
71
83
. '"Helvetica", Verdana, sans-serif;background: white;} '
72
84
. "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} " ,
73
85
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceAfterListArgumentSeparator (" " ))
74
86
);
75
87
}
76
88
77
- public function testSpaceAfterListArgumentSeparatorComplex ()
89
+ /**
90
+ * @test
91
+ */
92
+ public function spaceAfterListArgumentSeparatorComplex ()
78
93
{
79
- $ this -> assertSame (
94
+ self :: assertSame (
80
95
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;} '
81
96
. "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} " ,
82
97
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceAfterListArgumentSeparator ([
@@ -88,55 +103,73 @@ public function testSpaceAfterListArgumentSeparatorComplex()
88
103
);
89
104
}
90
105
91
- public function testSpaceAfterSelectorSeparator ()
106
+ /**
107
+ * @test
108
+ */
109
+ public function spaceAfterSelectorSeparator ()
92
110
{
93
- $ this -> assertSame (
111
+ self :: assertSame (
94
112
'.main,
95
113
.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
96
114
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
97
115
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceAfterSelectorSeparator ("\n" ))
98
116
);
99
117
}
100
118
101
- public function testStringQuotingType ()
119
+ /**
120
+ * @test
121
+ */
122
+ public function stringQuotingType ()
102
123
{
103
- $ this -> assertSame (
124
+ self :: assertSame (
104
125
'.main, .test {font: italic normal bold 16px/1.2 \'Helvetica \',Verdana,sans-serif;background: white;}
105
126
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
106
127
$ this ->oDocument ->render (OutputFormat::create ()->setStringQuotingType ("' " ))
107
128
);
108
129
}
109
130
110
- public function testRGBHashNotation ()
131
+ /**
132
+ * @test
133
+ */
134
+ public function rGBHashNotation ()
111
135
{
112
- $ this -> assertSame (
136
+ self :: assertSame (
113
137
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
114
138
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: rgb(255,255,255);}} ' ,
115
139
$ this ->oDocument ->render (OutputFormat::create ()->setRGBHashNotation (false ))
116
140
);
117
141
}
118
142
119
- public function testSemicolonAfterLastRule ()
143
+ /**
144
+ * @test
145
+ */
146
+ public function semicolonAfterLastRule ()
120
147
{
121
- $ this -> assertSame (
148
+ self :: assertSame (
122
149
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
123
150
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff}} ' ,
124
151
$ this ->oDocument ->render (OutputFormat::create ()->setSemicolonAfterLastRule (false ))
125
152
);
126
153
}
127
154
128
- public function testSpaceAfterRuleName ()
155
+ /**
156
+ * @test
157
+ */
158
+ public function spaceAfterRuleName ()
129
159
{
130
- $ this -> assertSame (
160
+ self :: assertSame (
131
161
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
132
162
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
133
163
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceAfterRuleName ("\t" ))
134
164
);
135
165
}
136
166
137
- public function testSpaceRules ()
167
+ /**
168
+ * @test
169
+ */
170
+ public function spaceRules ()
138
171
{
139
- $ this -> assertSame ('.main, .test {
172
+ self :: assertSame ('.main, .test {
140
173
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
141
174
background: white;
142
175
}
@@ -147,19 +180,25 @@ public function testSpaceRules()
147
180
}} ' , $ this ->oDocument ->render (OutputFormat::create ()->set ('Space*Rules ' , "\n" )));
148
181
}
149
182
150
- public function testSpaceBlocks ()
183
+ /**
184
+ * @test
185
+ */
186
+ public function spaceBlocks ()
151
187
{
152
- $ this -> assertSame ('
188
+ self :: assertSame ('
153
189
.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
154
190
@media screen {
155
191
.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}
156
192
}
157
193
' , $ this ->oDocument ->render (OutputFormat::create ()->set ('Space*Blocks ' , "\n" )));
158
194
}
159
195
160
- public function testSpaceBoth ()
196
+ /**
197
+ * @test
198
+ */
199
+ public function spaceBoth ()
161
200
{
162
- $ this -> assertSame ('
201
+ self :: assertSame ('
163
202
.main, .test {
164
203
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
165
204
background: white;
@@ -174,18 +213,24 @@ public function testSpaceBoth()
174
213
' , $ this ->oDocument ->render (OutputFormat::create ()->set ('Space*Rules ' , "\n" )->set ('Space*Blocks ' , "\n" )));
175
214
}
176
215
177
- public function testSpaceBetweenBlocks ()
216
+ /**
217
+ * @test
218
+ */
219
+ public function spaceBetweenBlocks ()
178
220
{
179
- $ this -> assertSame (
221
+ self :: assertSame (
180
222
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;} '
181
223
. '@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
182
224
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceBetweenBlocks ('' ))
183
225
);
184
226
}
185
227
186
- public function testIndentation ()
228
+ /**
229
+ * @test
230
+ */
231
+ public function indentation ()
187
232
{
188
- $ this -> assertSame ('
233
+ self :: assertSame ('
189
234
.main, .test {
190
235
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
191
236
background: white;
@@ -203,9 +248,12 @@ public function testIndentation()
203
248
->setIndentation ('' )));
204
249
}
205
250
206
- public function testSpaceBeforeBraces ()
251
+ /**
252
+ * @test
253
+ */
254
+ public function spaceBeforeBraces ()
207
255
{
208
- $ this -> assertSame (
256
+ self :: assertSame (
209
257
'.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
210
258
@media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
211
259
$ this ->oDocument ->render (OutputFormat::create ()->setSpaceBeforeOpeningBrace ('' ))
@@ -214,13 +262,15 @@ public function testSpaceBeforeBraces()
214
262
215
263
/**
216
264
* @expectedException \Sabberworm\CSS\Parsing\OutputException
265
+ *
266
+ * @test
217
267
*/
218
- public function testIgnoreExceptionsOff ()
268
+ public function ignoreExceptionsOff ()
219
269
{
220
270
$ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
221
271
$ oFirstBlock = $ aBlocks [0 ];
222
272
$ oFirstBlock ->removeSelector ('.main ' );
223
- $ this -> assertSame (
273
+ self :: assertSame (
224
274
'.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
225
275
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
226
276
$ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (false ))
@@ -229,13 +279,16 @@ public function testIgnoreExceptionsOff()
229
279
$ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (false ));
230
280
}
231
281
232
- public function testIgnoreExceptionsOn ()
282
+ /**
283
+ * @test
284
+ */
285
+ public function ignoreExceptionsOn ()
233
286
{
234
287
$ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
235
288
$ oFirstBlock = $ aBlocks [0 ];
236
289
$ oFirstBlock ->removeSelector ('.main ' );
237
290
$ oFirstBlock ->removeSelector ('.test ' );
238
- $ this -> assertSame (
291
+ self :: assertSame (
239
292
'@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' ,
240
293
$ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (true ))
241
294
);
0 commit comments