Skip to content

Commit a074ff5

Browse files
oliverkleeJakeQZ
andauthored
[CLEANUP] Avoid Hungarian notation in the tests (#1101)
Part of #756 Co-authored-by: JakeQZ <[email protected]>
1 parent 9f7bbbe commit a074ff5

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

tests/Comment/CommentTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class CommentTest extends TestCase
2020
*/
2121
public function keepCommentsInOutput(): void
2222
{
23-
$oCss = TestsParserTest::parsedStructureForFile('comments');
23+
$cssDocument = TestsParserTest::parsedStructureForFile('comments');
2424
self::assertSame('/** Number 11 **/
2525
2626
/**
@@ -45,15 +45,15 @@ public function keepCommentsInOutput(): void
4545
position: absolute;
4646
}
4747
}
48-
', $oCss->render(OutputFormat::createPretty()));
48+
', $cssDocument->render(OutputFormat::createPretty()));
4949
self::assertSame(
5050
'/** Number 11 **//**' . "\n"
5151
. ' * Comments' . "\n"
5252
. ' *//* Hell */@import url("some/url.css") screen;'
5353
. '/* Number 4 *//* Number 5 */.foo,#bar{'
5454
. '/* Number 6 */background-color:#000;}@media screen{'
5555
. '/** Number 10 **/#foo.bar{/** Number 10b **/position:absolute;}}',
56-
$oCss->render(OutputFormat::createCompact()->setRenderComments(true))
56+
$cssDocument->render(OutputFormat::createCompact()->setRenderComments(true))
5757
);
5858
}
5959

tests/ParserTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public function colorParsing(): void
161161
self::assertEmpty($colorRules);
162162
}
163163
}
164-
foreach ($document->getAllValues('color') as $sColor) {
165-
self::assertSame('red', $sColor);
164+
foreach ($document->getAllValues('color') as $colorValue) {
165+
self::assertSame('red', $colorValue);
166166
}
167167
self::assertSame(
168168
'#mine {color: red;border-color: #0a64e6;border-color: rgba(10,100,231,.3);outline-color: #222;'
@@ -463,9 +463,9 @@ public function functionSyntax(): void
463463
. '.collapser.expanded + * {height: auto;}';
464464
self::assertSame($expected, $document->render());
465465

466-
foreach ($document->getAllValues(null, true) as $mValue) {
467-
if ($mValue instanceof Size && $mValue->isSize()) {
468-
$mValue->setSize($mValue->getSize() * 3);
466+
foreach ($document->getAllValues(null, true) as $value) {
467+
if ($value instanceof Size && $value->isSize()) {
468+
$value->setSize($value->getSize() * 3);
469469
}
470470
}
471471
$expected = \str_replace(['1.2em', '.2em', '60%'], ['3.6em', '.6em', '180%'], $expected);
@@ -952,12 +952,12 @@ public function missingPropertyValueLenient(): void
952952
* Parses structure for file.
953953
*
954954
* @param string $filename
955-
* @param Settings|null $oSettings
955+
* @param Settings|null $settings
956956
*/
957-
public static function parsedStructureForFile($filename, $oSettings = null): Document
957+
public static function parsedStructureForFile($filename, $settings = null): Document
958958
{
959959
$filename = __DIR__ . "/fixtures/$filename.css";
960-
$parser = new Parser(\file_get_contents($filename), $oSettings);
960+
$parser = new Parser(\file_get_contents($filename), $settings);
961961
return $parser->parse();
962962
}
963963

@@ -1011,8 +1011,8 @@ public function lineNumbersParsing(): void
10111011
self::assertSame(27, $rules[1]->getLineNo());
10121012

10131013
$actualColorLineNumbers = [];
1014-
foreach ($valueOfSecondRule->getColor() as $oSize) {
1015-
$actualColorLineNumbers[] = $oSize->getLineNo();
1014+
foreach ($valueOfSecondRule->getColor() as $size) {
1015+
$actualColorLineNumbers[] = $size->getLineNo();
10161016
}
10171017

10181018
self::assertSame($expectedColorLineNumbers, $actualColorLineNumbers);
@@ -1044,16 +1044,16 @@ public function unexpectedTokenExceptionLineNo(): void
10441044
public function commentExtracting(): void
10451045
{
10461046
$document = self::parsedStructureForFile('comments');
1047-
$aNodes = $document->getContents();
1047+
$nodes = $document->getContents();
10481048

10491049
// Import property.
1050-
$importComments = $aNodes[0]->getComments();
1050+
$importComments = $nodes[0]->getComments();
10511051
self::assertCount(2, $importComments);
10521052
self::assertSame("*\n * Comments\n ", $importComments[0]->getComment());
10531053
self::assertSame(' Hell ', $importComments[1]->getComment());
10541054

10551055
// Declaration block.
1056-
$fooBarBlock = $aNodes[1];
1056+
$fooBarBlock = $nodes[1];
10571057
$fooBarBlockComments = $fooBarBlock->getComments();
10581058
// TODO Support comments in selectors.
10591059
// $this->assertCount(2, $fooBarBlockComments);
@@ -1068,11 +1068,11 @@ public function commentExtracting(): void
10681068
self::assertSame(' Number 6 ', $fooBarRuleComments[0]->getComment());
10691069

10701070
// Media property.
1071-
$mediaComments = $aNodes[2]->getComments();
1071+
$mediaComments = $nodes[2]->getComments();
10721072
self::assertCount(0, $mediaComments);
10731073

10741074
// Media children.
1075-
$mediaRules = $aNodes[2]->getContents();
1075+
$mediaRules = $nodes[2]->getContents();
10761076
$fooBarComments = $mediaRules[0]->getComments();
10771077
self::assertCount(1, $fooBarComments);
10781078
self::assertSame('* Number 10 *', $fooBarComments[0]->getComment());

tests/RuleSet/DeclarationBlockTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ final class DeclarationBlockTest extends TestCase
2121
*/
2222
public function overrideRules(): void
2323
{
24-
$sCss = '.wrapper { left: 10px; text-align: left; }';
25-
$parser = new Parser($sCss);
24+
$css = '.wrapper { left: 10px; text-align: left; }';
25+
$parser = new Parser($css);
2626
$document = $parser->parse();
2727
$rule = new Rule('right');
2828
$rule->setValue('-10px');
@@ -43,8 +43,8 @@ public function overrideRules(): void
4343
*/
4444
public function ruleInsertion(): void
4545
{
46-
$sCss = '.wrapper { left: 10px; text-align: left; }';
47-
$parser = new Parser($sCss);
46+
$css = '.wrapper { left: 10px; text-align: left; }';
47+
$parser = new Parser($css);
4848
$document = $parser->parse();
4949
$contents = $document->getContents();
5050
$wrapper = $contents[0];

0 commit comments

Comments
 (0)