File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
rules-tests/CodeQuality/Rector/MethodCall/MergeWithCallableAndWillReturnRector/Fixture Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \PHPUnit \CodeQuality \Rector \MethodCall \MergeWithCallableAndWillReturnRector \Fixture ;
4+
5+ final class DemoFile extends PHPUnit \Framework \TestCase
6+ {
7+ public function test_it (): void
8+ {
9+ $ initialStatements = [
10+ new FakeNode (),
11+ new FakeNode (),
12+ ];
13+
14+ $ this ->fileParserMock
15+ ->expects ($ this ->once ())
16+ ->method ('parse ' )
17+ ->with ($ this ->callback (
18+ function (SplFileInfo $ fileInfo ): bool {
19+ $ this ->assertSame ('/path/to/file ' , $ fileInfo ->getRealPath ());
20+
21+ return true ;
22+ },
23+ ))
24+ ->willReturn ([$ initialStatements , []])
25+ ;
26+ }
27+
28+ }
29+ ?>
30+ -----
31+ <?php
32+
33+ namespace Rector \Tests \PHPUnit \CodeQuality \Rector \MethodCall \MergeWithCallableAndWillReturnRector \Fixture ;
34+
35+ final class DemoFile extends PHPUnit \Framework \TestCase
36+ {
37+ public function test_it (): void
38+ {
39+ $ initialStatements = [
40+ new FakeNode (),
41+ new FakeNode (),
42+ ];
43+
44+ $ this ->fileParserMock
45+ ->expects ($ this ->once ())
46+ ->method ('parse ' )
47+ ->willReturnCallback (function (SplFileInfo $ fileInfo ) use ($ initialStatements ): array {
48+ $ this ->assertSame ('/path/to/file ' , $ fileInfo ->getRealPath ());
49+
50+ return [$ initialStatements , []];
51+ })
52+ ;
53+ }
54+
55+ }
56+ ?>
You can’t perform that action at this time.
0 commit comments