Skip to content

Commit 35684b3

Browse files
committed
Tests: Make sure fixtures are valid PHP
1 parent 8783aa0 commit 35684b3

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

tests/Sniffs/Functions/ClosureFixture.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,4 @@ public function hasClosureWithReturn() {
2020
return true;
2121
};
2222
}
23-
24-
public function hasClosureWithOneVoidReturnAndBoolHint() {
25-
// The next line should report an invalid void return
26-
$myFunc = function () : bool {
27-
if (rand(1, 10) > 5) {
28-
return true;
29-
}
30-
return;
31-
};
32-
}
3323
}

tests/Sniffs/Functions/TypeHintSniffTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testTypeHintSniffWithClosures() {
4040
$warningLines = $helper->getWarningLineNumbersFromFile($phpcsFile);
4141
$errorLines = $helper->getErrorLineNumbersFromFile($phpcsFile);
4242
$this->assertEquals([5, 11], $warningLines);
43-
$this->assertEquals([26], $errorLines);
43+
$this->assertEquals([], $errorLines);
4444
}
4545

4646
public function testTypeHintSniffWithInterface() {

0 commit comments

Comments
 (0)