Skip to content

Commit 7810213

Browse files
authored
[TASK] Avoid Hungarian notation in a testcase (#690)
1 parent ba3948e commit 7810213

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

tests/OutputFormatTest.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ final class OutputFormatTest extends TestCase
3636
/**
3737
* @var Parser
3838
*/
39-
private $oParser;
39+
private $parser;
4040

4141
/**
4242
* @var Document
4343
*/
44-
private $oDocument;
44+
private $document;
4545

4646
protected function setUp(): void
4747
{
48-
$this->oParser = new Parser(self::TEST_CSS);
49-
$this->oDocument = $this->oParser->parse();
48+
$this->parser = new Parser(self::TEST_CSS);
49+
$this->document = $this->parser->parse();
5050
}
5151

5252
/**
@@ -57,7 +57,7 @@ public function plain(): void
5757
self::assertSame(
5858
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
5959
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
60-
$this->oDocument->render()
60+
$this->document->render()
6161
);
6262
}
6363

@@ -69,7 +69,7 @@ public function compact(): void
6969
self::assertSame(
7070
'.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;}'
7171
. '@media screen{.main{background-size:100% 100%;font-size:1.3em;background-color:#fff;}}',
72-
$this->oDocument->render(OutputFormat::createCompact())
72+
$this->document->render(OutputFormat::createCompact())
7373
);
7474
}
7575

@@ -78,7 +78,7 @@ public function compact(): void
7878
*/
7979
public function pretty(): void
8080
{
81-
self::assertSame(self::TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
81+
self::assertSame(self::TEST_CSS, $this->document->render(OutputFormat::createPretty()));
8282
}
8383

8484
/**
@@ -90,7 +90,7 @@ public function spaceAfterListArgumentSeparator(): void
9090
'.main, .test {font: italic normal bold 16px/ 1.2 '
9191
. '"Helvetica", Verdana, sans-serif;background: white;}'
9292
. "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}",
93-
$this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(' '))
93+
$this->document->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(' '))
9494
);
9595
}
9696

@@ -102,7 +102,7 @@ public function spaceAfterListArgumentSeparatorComplex(): void
102102
self::assertSame(
103103
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;}'
104104
. "\n@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}",
105-
$this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator([
105+
$this->document->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator([
106106
'default' => ' ',
107107
',' => "\t",
108108
'/' => '',
@@ -120,7 +120,7 @@ public function spaceAfterSelectorSeparator(): void
120120
'.main,
121121
.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
122122
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
123-
$this->oDocument->render(OutputFormat::create()->setSpaceAfterSelectorSeparator("\n"))
123+
$this->document->render(OutputFormat::create()->setSpaceAfterSelectorSeparator("\n"))
124124
);
125125
}
126126

@@ -132,7 +132,7 @@ public function stringQuotingType(): void
132132
self::assertSame(
133133
'.main, .test {font: italic normal bold 16px/1.2 \'Helvetica\',Verdana,sans-serif;background: white;}
134134
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
135-
$this->oDocument->render(OutputFormat::create()->setStringQuotingType("'"))
135+
$this->document->render(OutputFormat::create()->setStringQuotingType("'"))
136136
);
137137
}
138138

@@ -144,7 +144,7 @@ public function rGBHashNotation(): void
144144
self::assertSame(
145145
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
146146
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: rgb(255,255,255);}}',
147-
$this->oDocument->render(OutputFormat::create()->setRGBHashNotation(false))
147+
$this->document->render(OutputFormat::create()->setRGBHashNotation(false))
148148
);
149149
}
150150

@@ -156,7 +156,7 @@ public function semicolonAfterLastRule(): void
156156
self::assertSame(
157157
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
158158
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff}}',
159-
$this->oDocument->render(OutputFormat::create()->setSemicolonAfterLastRule(false))
159+
$this->document->render(OutputFormat::create()->setSemicolonAfterLastRule(false))
160160
);
161161
}
162162

@@ -168,7 +168,7 @@ public function spaceAfterRuleName(): void
168168
self::assertSame(
169169
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
170170
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
171-
$this->oDocument->render(OutputFormat::create()->setSpaceAfterRuleName("\t"))
171+
$this->document->render(OutputFormat::create()->setSpaceAfterRuleName("\t"))
172172
);
173173
}
174174

@@ -185,7 +185,7 @@ public function spaceRules(): void
185185
background-size: 100% 100%;
186186
font-size: 1.3em;
187187
background-color: #fff;
188-
}}', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")));
188+
}}', $this->document->render(OutputFormat::create()->set('Space*Rules', "\n")));
189189
}
190190

191191
/**
@@ -198,7 +198,7 @@ public function spaceBlocks(): void
198198
@media screen {
199199
.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}
200200
}
201-
', $this->oDocument->render(OutputFormat::create()->set('Space*Blocks', "\n")));
201+
', $this->document->render(OutputFormat::create()->set('Space*Blocks', "\n")));
202202
}
203203

204204
/**
@@ -218,7 +218,7 @@ public function spaceBoth(): void
218218
background-color: #fff;
219219
}
220220
}
221-
', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")));
221+
', $this->document->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")));
222222
}
223223

224224
/**
@@ -229,7 +229,7 @@ public function spaceBetweenBlocks(): void
229229
self::assertSame(
230230
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}'
231231
. '@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
232-
$this->oDocument->render(OutputFormat::create()->setSpaceBetweenBlocks(''))
232+
$this->document->render(OutputFormat::create()->setSpaceBetweenBlocks(''))
233233
);
234234
}
235235

@@ -250,7 +250,7 @@ public function indentation(): void
250250
background-color: #fff;
251251
}
252252
}
253-
', $this->oDocument->render(OutputFormat::create()
253+
', $this->document->render(OutputFormat::create()
254254
->set('Space*Rules', "\n")
255255
->set('Space*Blocks', "\n")
256256
->setIndentation('')));
@@ -264,7 +264,7 @@ public function spaceBeforeBraces(): void
264264
self::assertSame(
265265
'.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
266266
@media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
267-
$this->oDocument->render(OutputFormat::create()->setSpaceBeforeOpeningBrace(''))
267+
$this->document->render(OutputFormat::create()->setSpaceBeforeOpeningBrace(''))
268268
);
269269
}
270270

@@ -275,30 +275,30 @@ public function ignoreExceptionsOff(): void
275275
{
276276
$this->expectException(OutputException::class);
277277

278-
$aBlocks = $this->oDocument->getAllDeclarationBlocks();
279-
$oFirstBlock = $aBlocks[0];
280-
$oFirstBlock->removeSelector('.main');
278+
$declarationBlocks = $this->document->getAllDeclarationBlocks();
279+
$firstDeclarationBlock = $declarationBlocks[0];
280+
$firstDeclarationBlock->removeSelector('.main');
281281
self::assertSame(
282282
'.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
283283
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
284-
$this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false))
284+
$this->document->render(OutputFormat::create()->setIgnoreExceptions(false))
285285
);
286-
$oFirstBlock->removeSelector('.test');
287-
$this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false));
286+
$firstDeclarationBlock->removeSelector('.test');
287+
$this->document->render(OutputFormat::create()->setIgnoreExceptions(false));
288288
}
289289

290290
/**
291291
* @test
292292
*/
293293
public function ignoreExceptionsOn(): void
294294
{
295-
$aBlocks = $this->oDocument->getAllDeclarationBlocks();
296-
$oFirstBlock = $aBlocks[0];
297-
$oFirstBlock->removeSelector('.main');
298-
$oFirstBlock->removeSelector('.test');
295+
$declarationBlocks = $this->document->getAllDeclarationBlocks();
296+
$firstDeclarationBlock = $declarationBlocks[0];
297+
$firstDeclarationBlock->removeSelector('.main');
298+
$firstDeclarationBlock->removeSelector('.test');
299299
self::assertSame(
300300
'@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}',
301-
$this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(true))
301+
$this->document->render(OutputFormat::create()->setIgnoreExceptions(true))
302302
);
303303
}
304304
}

0 commit comments

Comments
 (0)