@@ -23,14 +23,18 @@ protected function setUp(): void
2323
2424 public function testParsesAFilesOnlyParameters (): void
2525 {
26+ $ matcher = $ this ->exactly (2 );
2627 /** @var FileList|MockObject $fileList */
2728 $ fileList = $ this ->createMock (FileList::class);
28- $ fileList ->expects ($ this -> exactly ( 2 ) )
29+ $ fileList ->expects ($ matcher )
2930 ->method ('addFile ' )
30- ->withConsecutive (
31- ['abc.php ' ],
32- ['cde.md ' ]
33- );
31+ ->willReturnCallback (function (...$ args ) use ($ matcher ) {
32+ $ expected = [
33+ ['abc.php ' ],
34+ ['cde.md ' ],
35+ ];
36+ $ this ->assertEquals ($ expected [$ matcher ->numberOfInvocations () - 1 ], $ args );
37+ });
3438
3539 $ this ->cLI = new CLI ($ fileList , ['abc.php ' , 'cde.md ' ]);
3640 $ this ->assertSame ($ fileList , $ this ->cLI ->getFilesToParse ());
@@ -39,14 +43,18 @@ public function testParsesAFilesOnlyParameters(): void
3943
4044 public function testParsesAFileAnIncludeFileMix (): void
4145 {
46+ $ matcher = $ this ->exactly (2 );
4247 /** @var FileList|MockObject $fileList */
4348 $ fileList = $ this ->createMock (FileList::class);
44- $ fileList ->expects ($ this -> exactly ( 2 ) )
49+ $ fileList ->expects ($ matcher )
4550 ->method ('addFile ' )
46- ->withConsecutive (
47- ['abc.php ' ],
48- ['cde.md ' ]
49- );
51+ ->willReturnCallback (function (...$ args ) use ($ matcher ) {
52+ $ expected = [
53+ ['abc.php ' ],
54+ ['cde.md ' ],
55+ ];
56+ $ this ->assertEquals ($ expected [$ matcher ->numberOfInvocations () - 1 ], $ args );
57+ });
5058
5159 $ this ->workDir ->addChild (vfsStream::newFile ('bananas.php ' ));
5260 $ this ->cLI = new CLI ($ fileList , ['abc.php ' , '-i ' , 'vfs://workDir/bananas.php ' , 'cde.md ' ]);
@@ -56,14 +64,18 @@ public function testParsesAFileAnIncludeFileMix(): void
5664
5765 public function testHasNoIncludeFileIfNoValueWasGiven (): void
5866 {
67+ $ matcher = $ this ->exactly (2 );
5968 /** @var FileList|MockObject $fileList */
6069 $ fileList = $ this ->createMock (FileList::class);
61- $ fileList ->expects ($ this -> exactly ( 2 ) )
70+ $ fileList ->expects ($ matcher )
6271 ->method ('addFile ' )
63- ->withConsecutive (
64- ['abc.php ' ],
65- ['cde.md ' ]
66- );
72+ ->willReturnCallback (function (...$ args ) use ($ matcher ) {
73+ $ expected = [
74+ ['abc.php ' ],
75+ ['cde.md ' ],
76+ ];
77+ $ this ->assertEquals ($ expected [$ matcher ->numberOfInvocations () - 1 ], $ args );
78+ });
6779
6880 $ this ->cLI = new CLI ($ fileList , ['abc.php ' , 'cde.md ' , '-i ' ]);
6981 $ this ->assertSame ($ fileList , $ this ->cLI ->getFilesToParse ());
0 commit comments