Skip to content

Commit ddd2da5

Browse files
committed
[CLEANUP] Reorder and group some tests for CSSList
This is a pre-patch to having dedicated tests for some of our abstract classes in order to avoid duplicated tests. This change merely moves tests around in the test classes (and fixing two incorrectly named tests), but does not change the tests themselves in any way.
1 parent e725c2e commit ddd2da5

File tree

3 files changed

+18
-26
lines changed

3 files changed

+18
-26
lines changed

tests/Unit/CSSList/AtRuleBlockListTest.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function isCSSList(): void
6262
}
6363

6464
/*
65-
* not grouped yet
65+
* Tests for the constructor and its parameters
6666
*/
6767

6868
/**
@@ -77,6 +77,10 @@ public function atRuleNameReturnsTypeProvidedToConstructor(): void
7777
self::assertSame($type, $subject->atRuleName());
7878
}
7979

80+
/*
81+
* Tests for functionality implemented by the tested class itself
82+
*/
83+
8084
/**
8185
* @test
8286
*/
@@ -102,22 +106,26 @@ public function atRuleArgsReturnsArgumentsProvidedToConstructor(): void
102106
/**
103107
* @test
104108
*/
105-
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
109+
public function isRootListAlwaysReturnsFalse(): void
106110
{
107-
$lineNumber = 42;
108-
109-
$subject = new AtRuleBlockList('', '', $lineNumber);
111+
$subject = new AtRuleBlockList('supports');
110112

111-
self::assertSame($lineNumber, $subject->getLineNo());
113+
self::assertFalse($subject->isRootList());
112114
}
113115

116+
/*
117+
* Tests for functionality implemented in `CSSBlockList`
118+
*/
119+
114120
/**
115121
* @test
116122
*/
117-
public function isRootListAlwaysReturnsFalse(): void
123+
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
118124
{
119-
$subject = new AtRuleBlockList('supports');
125+
$lineNumber = 42;
120126

121-
self::assertFalse($subject->isRootList());
127+
$subject = new AtRuleBlockList('', '', $lineNumber);
128+
129+
self::assertSame($lineNumber, $subject->getLineNo());
122130
}
123131
}

tests/Unit/CSSList/DocumentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function isCSSList(): void
5454
}
5555

5656
/*
57-
* not grouped yet
57+
* Tests for functionality implemented by the tested class itself
5858
*/
5959

6060
/**

tests/Unit/CSSList/KeyFrameTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,4 @@ public function isCSSList(): void
6060

6161
self::assertInstanceOf(CSSList::class, $subject);
6262
}
63-
64-
/*
65-
* not grouped yet
66-
*/
67-
68-
/**
69-
* @test
70-
*/
71-
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
72-
{
73-
$lineNumber = 42;
74-
75-
$subject = new KeyFrame($lineNumber);
76-
77-
self::assertSame($lineNumber, $subject->getLineNo());
78-
}
7963
}

0 commit comments

Comments
 (0)