3
3
4
4
namespace Spaze \PHPStan \Rules \Disallowed \Calls ;
5
5
6
- use PHPStan \Rules \Rule ;
7
6
use PHPStan \ShouldNotHappenException ;
8
- use PHPStan \Testing \RuleTestCase ;
7
+ use PHPStan \Testing \PHPStanTestCase ;
9
8
use Spaze \PHPStan \Rules \Disallowed \DisallowedCallFactory ;
10
- use Spaze \PHPStan \Rules \Disallowed \Exceptions \UnsupportedParamTypeInConfigException ;
11
9
use Spaze \PHPStan \Rules \Disallowed \RuleErrors \DisallowedCallsRuleErrors ;
12
10
13
- class FunctionCallsTypeStringParamsInvalidFlagsConfigTest extends RuleTestCase
11
+ class FunctionCallsTypeStringParamsInvalidFlagsConfigTest extends PHPStanTestCase
14
12
{
15
13
16
14
/**
17
15
* @throws ShouldNotHappenException
18
16
*/
19
- protected function getRule (): Rule
17
+ public function testException (): void
20
18
{
19
+ $ this ->expectException (ShouldNotHappenException::class);
20
+ $ this ->expectExceptionMessage ("Foo\Bar\Waldo\intParam1(): Parameter #1 has an unsupported type string of 2|'bruh' specified in configuration " );
21
21
$ container = self ::getContainer ();
22
- return new FunctionCalls (
22
+ new FunctionCalls (
23
23
$ container ->getByType (DisallowedCallsRuleErrors::class),
24
24
$ container ->getByType (DisallowedCallFactory::class),
25
25
$ this ->createReflectionProvider (),
@@ -38,14 +38,6 @@ protected function getRule(): Rule
38
38
}
39
39
40
40
41
- public function testException (): void
42
- {
43
- $ this ->expectException (UnsupportedParamTypeInConfigException::class);
44
- $ this ->expectExceptionMessage ("Parameter #1 has an unsupported type string of 2|'bruh' specified in configuration " );
45
- $ this ->analyse ([__DIR__ . '/../src/disallowed/functionCallsTypeStringParams.php ' ], []);
46
- }
47
-
48
-
49
41
public static function getAdditionalConfigFiles (): array
50
42
{
51
43
return [
0 commit comments