99use PHPStan \File \FileReader ;
1010use PHPStan \Testing \PHPStanTestCase ;
1111use PHPUnit \Framework \Attributes \DataProvider ;
12- use PHPUnit \Framework \MockObject \MockObject ;
12+ use PHPUnit \Framework \MockObject \Stub ;
1313
1414class CachedParserTest extends PHPStanTestCase
1515{
@@ -21,7 +21,7 @@ public function testParseFileClearCache(
2121 ): void
2222 {
2323 $ parser = new CachedParser (
24- $ this ->getParserMock (),
24+ $ this ->getParserStub (),
2525 $ cachedNodesByStringCountMax ,
2626 );
2727
@@ -62,19 +62,19 @@ public static function dataParseFileClearCache(): Generator
6262 ];
6363 }
6464
65- private function getParserMock (): Parser &MockObject
65+ private function getParserStub (): Parser &Stub
6666 {
67- $ mock = $ this ->createMock (Parser::class);
67+ $ mock = $ this ->createStub (Parser::class);
6868
69- $ mock ->method ('parseFile ' )->willReturn ([$ this ->getPhpParserNodeMock ()]);
70- $ mock ->method ('parseString ' )->willReturn ([$ this ->getPhpParserNodeMock ()]);
69+ $ mock ->method ('parseFile ' )->willReturn ([$ this ->getPhpParserNodeStub ()]);
70+ $ mock ->method ('parseString ' )->willReturn ([$ this ->getPhpParserNodeStub ()]);
7171
7272 return $ mock ;
7373 }
7474
75- private function getPhpParserNodeMock (): Node &MockObject
75+ private function getPhpParserNodeStub (): Node &Stub
7676 {
77- return $ this ->createMock (Node::class);
77+ return $ this ->createStub (Node::class);
7878 }
7979
8080 public function testParseTheSameFileWithDifferentMethod (): void
0 commit comments