Skip to content

Commit 7142ddc

Browse files
committed
Fix tests
1 parent b46e496 commit 7142ddc

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

tests/PHPStan/Rules/Exceptions/ThrowsVoidFunctionWithExplicitThrowPointRuleTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7+
use ThrowsVoidFunction\DifferentException;
78
use ThrowsVoidFunction\MyException;
89

910
/**
@@ -38,7 +39,13 @@ public function dataRule(): array
3839
],
3940
[
4041
false,
41-
['DifferentException'],
42+
[DifferentException::class],
43+
[
44+
[
45+
'Function ThrowsVoidFunction\foo() throws exception ThrowsVoidFunction\MyException but the PHPDoc contains @throws void.',
46+
15,
47+
],
48+
],
4249
[
4350
[
4451
'Function ThrowsVoidFunction\foo() throws exception ThrowsVoidFunction\MyException but the PHPDoc contains @throws void.',
@@ -53,7 +60,7 @@ public function dataRule(): array
5360
],
5461
[
5562
true,
56-
['DifferentException'],
63+
[DifferentException::class],
5764
[
5865
[
5966
'Function ThrowsVoidFunction\foo() throws exception ThrowsVoidFunction\MyException but the PHPDoc contains @throws void.',

tests/PHPStan/Rules/Exceptions/ThrowsVoidPropertyHookWithExplicitThrowPointRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function dataRule(): array
3838
],
3939
[
4040
false,
41-
['DifferentException'],
41+
['ThrowsVoidPropertyHook\\DifferentException'],
4242
[
4343
[
4444
'Get hook for property ThrowsVoidPropertyHook\Foo::$i throws exception ThrowsVoidPropertyHook\MyException but the PHPDoc contains @throws void.',
@@ -57,7 +57,7 @@ public function dataRule(): array
5757
],
5858
[
5959
true,
60-
['DifferentException'],
60+
['ThrowsVoidPropertyHook\\DifferentException'],
6161
[
6262
[
6363
'Get hook for property ThrowsVoidPropertyHook\Foo::$i throws exception ThrowsVoidPropertyHook\MyException but the PHPDoc contains @throws void.',

tests/PHPStan/Rules/Exceptions/data/throws-void-function.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace ThrowsVoidFunction;
44

5-
class MyException extends \Exception
6-
{
5+
class MyException extends \Exception {}
6+
7+
class DifferentException extends \Exception {}
78

8-
}
99

1010
/**
1111
* @throws void

tests/PHPStan/Rules/Exceptions/data/throws-void-property-hook.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace ThrowsVoidPropertyHook;
44

5-
class MyException extends \Exception
6-
{
5+
class MyException extends \Exception {}
6+
7+
class DifferentException extends \Exception {}
78

8-
}
99

1010
class Foo
1111
{

0 commit comments

Comments
 (0)