Skip to content

Commit 5d2050b

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 321dc5e commit 5d2050b

File tree

3 files changed

+156
-132
lines changed

3 files changed

+156
-132
lines changed

tests/Unit/CSSList/AtRuleBlockListTest.php

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
final class AtRuleBlockListTest extends TestCase
1818
{
1919
/*
20-
* Tests for the implemented interfaces
21-
*/
20+
* Tests for the implemented interfaces
21+
*/
2222

2323
/**
2424
* @test
@@ -51,7 +51,7 @@ public function implementsCommentable(): void
5151
}
5252

5353
/*
54-
* not grouped yet
54+
* Tests for the constructor and its parameters
5555
*/
5656

5757
/**
@@ -66,15 +66,9 @@ public function atRuleNameReturnsTypeProvidedToConstructor(): void
6666
self::assertSame($type, $subject->atRuleName());
6767
}
6868

69-
/**
70-
* @test
69+
/*
70+
* Tests for functionality implemented by the tested class itself
7171
*/
72-
public function getLineNoByDefaultReturnsZero(): void
73-
{
74-
$subject = new AtRuleBlockList('supports');
75-
76-
self::assertSame(0, $subject->getLineNo());
77-
}
7872

7973
/**
8074
* @test
@@ -101,22 +95,40 @@ public function atRuleArgsReturnsArgumentsProvidedToConstructor(): void
10195
/**
10296
* @test
10397
*/
104-
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
98+
public function isRootListAlwaysReturnsFalse(): void
10599
{
106-
$lineNumber = 42;
107-
108-
$subject = new AtRuleBlockList('', '', $lineNumber);
100+
$subject = new AtRuleBlockList('supports');
109101

110-
self::assertSame($lineNumber, $subject->getLineNo());
102+
self::assertFalse($subject->isRootList());
111103
}
112104

105+
/*
106+
* Tests for functionality implemented in `CSSBlockList`
107+
*/
108+
109+
/*
110+
* Tests for functionality implemented in `CSSList`
111+
*/
112+
113113
/**
114114
* @test
115115
*/
116-
public function isRootListAlwaysReturnsFalse(): void
116+
public function getLineNoByDefaultReturnsZero(): void
117117
{
118118
$subject = new AtRuleBlockList('supports');
119119

120-
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());
121133
}
122134
}

0 commit comments

Comments
 (0)