Skip to content

Commit 4ac19de

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 6f1fc2c commit 4ac19de

File tree

3 files changed

+170
-122
lines changed

3 files changed

+170
-122
lines changed

tests/Unit/CSSList/AtRuleBlockListTest.php

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
*/
1717
final class AtRuleBlockListTest extends TestCase
1818
{
19+
/*
20+
* Tests for the implemented interfaces
21+
*/
22+
1923
/**
2024
* @test
2125
*/
@@ -46,6 +50,10 @@ public function implementsCommentable(): void
4650
self::assertInstanceOf(Commentable::class, $subject);
4751
}
4852

53+
/*
54+
* Tests for the constructor and its parameters
55+
*/
56+
4957
/**
5058
* @test
5159
*/
@@ -58,15 +66,9 @@ public function atRuleNameReturnsTypeProvidedToConstructor(): void
5866
self::assertSame($type, $subject->atRuleName());
5967
}
6068

61-
/**
62-
* @test
69+
/*
70+
* Tests for functionality implemented by the tested class itself
6371
*/
64-
public function getLineNoByDefaultReturnsZero(): void
65-
{
66-
$subject = new AtRuleBlockList('supports');
67-
68-
self::assertSame(0, $subject->getLineNo());
69-
}
7072

7173
/**
7274
* @test
@@ -93,22 +95,40 @@ public function atRuleArgsReturnsArgumentsProvidedToConstructor(): void
9395
/**
9496
* @test
9597
*/
96-
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
98+
public function isRootListAlwaysReturnsFalse(): void
9799
{
98-
$lineNumber = 42;
99-
100-
$subject = new AtRuleBlockList('', '', $lineNumber);
100+
$subject = new AtRuleBlockList('supports');
101101

102-
self::assertSame($lineNumber, $subject->getLineNo());
102+
self::assertFalse($subject->isRootList());
103103
}
104104

105+
/*
106+
* Tests for functionality implemented in `CSSBlockList`
107+
*/
108+
109+
/*
110+
* Tests for functionality implemented in `CSSList`
111+
*/
112+
105113
/**
106114
* @test
107115
*/
108-
public function isRootListAlwaysReturnsFalse(): void
116+
public function getLineNoByDefaultReturnsZero(): void
109117
{
110118
$subject = new AtRuleBlockList('supports');
111119

112-
self::assertFalse($subject->isRootList());
120+
self::assertSame(0, $subject->getLineNo());
121+
}
122+
123+
/**
124+
* @test
125+
*/
126+
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
127+
{
128+
$lineNumber = 42;
129+
130+
$subject = new AtRuleBlockList('', '', $lineNumber);
131+
132+
self::assertSame($lineNumber, $subject->getLineNo());
113133
}
114134
}

0 commit comments

Comments
 (0)