Skip to content

Commit 3c2e4e0

Browse files
authored
[CLEANUP] rector: Add void to PHPUnit test methods (#555)
This applies the rule AddTestsVoidReturnTypeWhereNoReturnRector. For Details see: https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#addtestsvoidreturntypewherenoreturnrector Signed-off-by: Daniel Ziegenberg <[email protected]>
1 parent 44eb684 commit 3c2e4e0

File tree

9 files changed

+124
-124
lines changed

9 files changed

+124
-124
lines changed

tests/CSSList/AtRuleBlockListTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function provideSyntacticlyCorrectAtRule(): array
5050
/**
5151
* @test
5252
*/
53-
public function implementsAtRule()
53+
public function implementsAtRule(): void
5454
{
5555
$subject = new AtRuleBlockList('');
5656

@@ -60,7 +60,7 @@ public function implementsAtRule()
6060
/**
6161
* @test
6262
*/
63-
public function implementsRenderable()
63+
public function implementsRenderable(): void
6464
{
6565
$subject = new AtRuleBlockList('');
6666

@@ -70,7 +70,7 @@ public function implementsRenderable()
7070
/**
7171
* @test
7272
*/
73-
public function implementsCommentable()
73+
public function implementsCommentable(): void
7474
{
7575
$subject = new AtRuleBlockList('');
7676

@@ -84,7 +84,7 @@ public function implementsCommentable()
8484
*
8585
* @dataProvider provideMinWidthMediaRule
8686
*/
87-
public function parsesRuleNameOfMediaQueries($css)
87+
public function parsesRuleNameOfMediaQueries($css): void
8888
{
8989
$contents = (new Parser($css))->parse()->getContents();
9090
$atRuleBlockList = $contents[0];
@@ -99,7 +99,7 @@ public function parsesRuleNameOfMediaQueries($css)
9999
*
100100
* @dataProvider provideMinWidthMediaRule
101101
*/
102-
public function parsesArgumentsOfMediaQueries($css)
102+
public function parsesArgumentsOfMediaQueries($css): void
103103
{
104104
$contents = (new Parser($css))->parse()->getContents();
105105
$atRuleBlockList = $contents[0];

tests/CSSList/DocumentTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ protected function setUp(): void
2626
/**
2727
* @test
2828
*/
29-
public function implementsRenderable()
29+
public function implementsRenderable(): void
3030
{
3131
self::assertInstanceOf(Renderable::class, $this->subject);
3232
}
3333

3434
/**
3535
* @test
3636
*/
37-
public function implementsCommentable()
37+
public function implementsCommentable(): void
3838
{
3939
self::assertInstanceOf(Commentable::class, $this->subject);
4040
}
4141

4242
/**
4343
* @test
4444
*/
45-
public function getContentsInitiallyReturnsEmptyArray()
45+
public function getContentsInitiallyReturnsEmptyArray(): void
4646
{
4747
self::assertSame([], $this->subject->getContents());
4848
}
@@ -66,7 +66,7 @@ public static function contentsDataProvider()
6666
*
6767
* @dataProvider contentsDataProvider
6868
*/
69-
public function setContentsSetsContents(array $contents)
69+
public function setContentsSetsContents(array $contents): void
7070
{
7171
$this->subject->setContents($contents);
7272

@@ -76,7 +76,7 @@ public function setContentsSetsContents(array $contents)
7676
/**
7777
* @test
7878
*/
79-
public function setContentsReplacesContentsSetInPreviousCall()
79+
public function setContentsReplacesContentsSetInPreviousCall(): void
8080
{
8181
$contents2 = [new DeclarationBlock()];
8282

tests/CSSList/KeyFrameTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ protected function setUp(): void
2626
/**
2727
* @test
2828
*/
29-
public function implementsAtRule()
29+
public function implementsAtRule(): void
3030
{
3131
self::assertInstanceOf(AtRule::class, $this->subject);
3232
}
3333

3434
/**
3535
* @test
3636
*/
37-
public function implementsRenderable()
37+
public function implementsRenderable(): void
3838
{
3939
self::assertInstanceOf(Renderable::class, $this->subject);
4040
}
4141

4242
/**
4343
* @test
4444
*/
45-
public function implementsCommentable()
45+
public function implementsCommentable(): void
4646
{
4747
self::assertInstanceOf(Commentable::class, $this->subject);
4848
}

tests/Comment/CommentTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class CommentTest extends TestCase
1919
/**
2020
* @test
2121
*/
22-
public function implementsRenderable()
22+
public function implementsRenderable(): void
2323
{
2424
$subject = new Comment();
2525

@@ -29,7 +29,7 @@ public function implementsRenderable()
2929
/**
3030
* @test
3131
*/
32-
public function getCommentOnEmptyInstanceReturnsReturnsEmptyString()
32+
public function getCommentOnEmptyInstanceReturnsReturnsEmptyString(): void
3333
{
3434
$subject = new Comment();
3535

@@ -39,7 +39,7 @@ public function getCommentOnEmptyInstanceReturnsReturnsEmptyString()
3939
/**
4040
* @test
4141
*/
42-
public function getCommentInitiallyReturnsCommentPassedToConstructor()
42+
public function getCommentInitiallyReturnsCommentPassedToConstructor(): void
4343
{
4444
$comment = 'There is no spoon.';
4545
$subject = new Comment($comment);
@@ -50,7 +50,7 @@ public function getCommentInitiallyReturnsCommentPassedToConstructor()
5050
/**
5151
* @test
5252
*/
53-
public function setCommentSetsComments()
53+
public function setCommentSetsComments(): void
5454
{
5555
$comment = 'There is no spoon.';
5656
$subject = new Comment();
@@ -63,7 +63,7 @@ public function setCommentSetsComments()
6363
/**
6464
* @test
6565
*/
66-
public function getLineNoOnEmptyInstanceReturnsReturnsZero()
66+
public function getLineNoOnEmptyInstanceReturnsReturnsZero(): void
6767
{
6868
$subject = new Comment();
6969

@@ -73,7 +73,7 @@ public function getLineNoOnEmptyInstanceReturnsReturnsZero()
7373
/**
7474
* @test
7575
*/
76-
public function getLineNoInitiallyReturnsLineNumberPassedToConstructor()
76+
public function getLineNoInitiallyReturnsLineNumberPassedToConstructor(): void
7777
{
7878
$lineNumber = 42;
7979
$subject = new Comment('', $lineNumber);
@@ -84,7 +84,7 @@ public function getLineNoInitiallyReturnsLineNumberPassedToConstructor()
8484
/**
8585
* @test
8686
*/
87-
public function toStringRendersCommentEnclosedInCommentDelimiters()
87+
public function toStringRendersCommentEnclosedInCommentDelimiters(): void
8888
{
8989
$comment = 'There is no spoon.';
9090
$subject = new Comment();
@@ -97,7 +97,7 @@ public function toStringRendersCommentEnclosedInCommentDelimiters()
9797
/**
9898
* @test
9999
*/
100-
public function renderRendersCommentEnclosedInCommentDelimiters()
100+
public function renderRendersCommentEnclosedInCommentDelimiters(): void
101101
{
102102
$comment = 'There is no spoon.';
103103
$subject = new Comment();
@@ -110,7 +110,7 @@ public function renderRendersCommentEnclosedInCommentDelimiters()
110110
/**
111111
* @test
112112
*/
113-
public function keepCommentsInOutput()
113+
public function keepCommentsInOutput(): void
114114
{
115115
$oCss = TestsParserTest::parsedStructureForFile('comments');
116116
self::assertSame('/** Number 11 **/
@@ -152,7 +152,7 @@ public function keepCommentsInOutput()
152152
/**
153153
* @test
154154
*/
155-
public function stripCommentsFromOutput()
155+
public function stripCommentsFromOutput(): void
156156
{
157157
$oCss = TestsParserTest::parsedStructureForFile('comments');
158158
self::assertSame('

tests/OutputFormatTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function setUp(): void
5252
/**
5353
* @test
5454
*/
55-
public function plain()
55+
public function plain(): void
5656
{
5757
self::assertSame(
5858
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -64,7 +64,7 @@ public function plain()
6464
/**
6565
* @test
6666
*/
67-
public function compact()
67+
public function compact(): void
6868
{
6969
self::assertSame(
7070
'.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;}'
@@ -76,15 +76,15 @@ public function compact()
7676
/**
7777
* @test
7878
*/
79-
public function pretty()
79+
public function pretty(): void
8080
{
8181
self::assertSame(self::TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
8282
}
8383

8484
/**
8585
* @test
8686
*/
87-
public function spaceAfterListArgumentSeparator()
87+
public function spaceAfterListArgumentSeparator(): void
8888
{
8989
self::assertSame(
9090
'.main, .test {font: italic normal bold 16px/ 1.2 '
@@ -97,7 +97,7 @@ public function spaceAfterListArgumentSeparator()
9797
/**
9898
* @test
9999
*/
100-
public function spaceAfterListArgumentSeparatorComplex()
100+
public function spaceAfterListArgumentSeparatorComplex(): void
101101
{
102102
self::assertSame(
103103
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;}'
@@ -114,7 +114,7 @@ public function spaceAfterListArgumentSeparatorComplex()
114114
/**
115115
* @test
116116
*/
117-
public function spaceAfterSelectorSeparator()
117+
public function spaceAfterSelectorSeparator(): void
118118
{
119119
self::assertSame(
120120
'.main,
@@ -127,7 +127,7 @@ public function spaceAfterSelectorSeparator()
127127
/**
128128
* @test
129129
*/
130-
public function stringQuotingType()
130+
public function stringQuotingType(): void
131131
{
132132
self::assertSame(
133133
'.main, .test {font: italic normal bold 16px/1.2 \'Helvetica\',Verdana,sans-serif;background: white;}
@@ -139,7 +139,7 @@ public function stringQuotingType()
139139
/**
140140
* @test
141141
*/
142-
public function rGBHashNotation()
142+
public function rGBHashNotation(): void
143143
{
144144
self::assertSame(
145145
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -151,7 +151,7 @@ public function rGBHashNotation()
151151
/**
152152
* @test
153153
*/
154-
public function semicolonAfterLastRule()
154+
public function semicolonAfterLastRule(): void
155155
{
156156
self::assertSame(
157157
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
@@ -163,7 +163,7 @@ public function semicolonAfterLastRule()
163163
/**
164164
* @test
165165
*/
166-
public function spaceAfterRuleName()
166+
public function spaceAfterRuleName(): void
167167
{
168168
self::assertSame(
169169
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -175,7 +175,7 @@ public function spaceAfterRuleName()
175175
/**
176176
* @test
177177
*/
178-
public function spaceRules()
178+
public function spaceRules(): void
179179
{
180180
self::assertSame('.main, .test {
181181
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
@@ -191,7 +191,7 @@ public function spaceRules()
191191
/**
192192
* @test
193193
*/
194-
public function spaceBlocks()
194+
public function spaceBlocks(): void
195195
{
196196
self::assertSame('
197197
.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -204,7 +204,7 @@ public function spaceBlocks()
204204
/**
205205
* @test
206206
*/
207-
public function spaceBoth()
207+
public function spaceBoth(): void
208208
{
209209
self::assertSame('
210210
.main, .test {
@@ -224,7 +224,7 @@ public function spaceBoth()
224224
/**
225225
* @test
226226
*/
227-
public function spaceBetweenBlocks()
227+
public function spaceBetweenBlocks(): void
228228
{
229229
self::assertSame(
230230
'.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}'
@@ -236,7 +236,7 @@ public function spaceBetweenBlocks()
236236
/**
237237
* @test
238238
*/
239-
public function indentation()
239+
public function indentation(): void
240240
{
241241
self::assertSame('
242242
.main, .test {
@@ -259,7 +259,7 @@ public function indentation()
259259
/**
260260
* @test
261261
*/
262-
public function spaceBeforeBraces()
262+
public function spaceBeforeBraces(): void
263263
{
264264
self::assertSame(
265265
'.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
@@ -271,7 +271,7 @@ public function spaceBeforeBraces()
271271
/**
272272
* @test
273273
*/
274-
public function ignoreExceptionsOff()
274+
public function ignoreExceptionsOff(): void
275275
{
276276
$this->expectException(OutputException::class);
277277

@@ -290,7 +290,7 @@ public function ignoreExceptionsOff()
290290
/**
291291
* @test
292292
*/
293-
public function ignoreExceptionsOn()
293+
public function ignoreExceptionsOn(): void
294294
{
295295
$aBlocks = $this->oDocument->getAllDeclarationBlocks();
296296
$oFirstBlock = $aBlocks[0];

0 commit comments

Comments
 (0)