File tree Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,8 @@ parameters:
14
14
message : " #^Accessing PHPStan\\\\ Rules\\\\ Comparison\\\\ ImpossibleCheckTypeMethodCallRule\\ :\\ :class is not covered by backward compatibility promise\\ . The class might change in a minor PHPStan version\\ .$#"
15
15
count : 1
16
16
path : tests/Rules/PHPUnit/ImpossibleCheckTypeMethodCallRuleTest.php
17
+
18
+ -
19
+ message : " #^Accessing PHPStan\\\\ Rules\\\\ Methods\\\\ CallMethodsRule\\ :\\ :class is not covered by backward compatibility promise\\ . The class might change in a minor PHPStan version\\ .$#"
20
+ count : 1
21
+ path : tests/Rules/Methods/CallMethodsRuleTest.php
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace PHPStan \Rules \Methods ;
4
+
5
+ use PHPStan \Rules \Rule ;
6
+ use PHPStan \Testing \RuleTestCase ;
7
+
8
+ /**
9
+ * @extends RuleTestCase<CallMethodsRule>
10
+ */
11
+ class CallMethodsRuleTest extends RuleTestCase
12
+ {
13
+
14
+ protected function getRule (): Rule
15
+ {
16
+ return self ::getContainer ()->getByType (CallMethodsRule::class);
17
+ }
18
+
19
+ public function testBug222 (): void
20
+ {
21
+ $ this ->analyse ([__DIR__ . '/data/bug-222.php ' ], []);
22
+ }
23
+
24
+ /**
25
+ * @return string[]
26
+ */
27
+ public static function getAdditionalConfigFiles (): array
28
+ {
29
+ return [
30
+ __DIR__ . '/../../../extension.neon ' ,
31
+ ];
32
+ }
33
+
34
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug222 ;
4
+
5
+ use PHPUnit \Framework \MockObject \MockObject ;
6
+ use PHPUnit \Framework \TestCase ;
7
+
8
+ class Foo extends TestCase
9
+ {
10
+
11
+ public function doFoo (MockObject $ mockService ): void
12
+ {
13
+ $ mockService
14
+ ->expects ($ this ->exactly (1 ))
15
+ ->method ('get ' )
16
+ ->with (24 )
17
+ ->willReturn ('24 ' );
18
+
19
+ $ mockService
20
+ ->method ('get ' )
21
+ ->with (24 )
22
+ ->willReturn ('24 ' );
23
+
24
+ $ mockService
25
+ ->expects ($ this ->exactly (1 ))
26
+ ->method ('get ' )
27
+ ->willReturn ('24 ' );
28
+
29
+ $ mockService
30
+ ->method ('get ' )
31
+ ->willReturn ('24 ' );
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments