File tree Expand file tree Collapse file tree
tests/Phinx/Console/Command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,12 +209,17 @@ public function testExecuteMultipleSeeders()
209209 $ managerStub = $ this ->getMockBuilder ('\Phinx\Migration\Manager ' )
210210 ->setConstructorArgs ([$ this ->config , $ this ->input , $ this ->output ])
211211 ->getMock ();
212- $ managerStub ->expects ($ this ->exactly (3 ))
213- ->method ('seed ' )->withConsecutive (
214- [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('One ' )],
215- [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('Two ' )],
216- [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('Three ' )],
217- );
212+ $ matcher = $ this ->exactly (3 );
213+ $ managerStub
214+ ->expects ($ matcher )
215+ ->method ('seed ' )
216+ ->willReturnCallback (function () use ($ matcher ) {
217+ match ($ matcher ->numberOfInvocations ()) {
218+ 1 => [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('One ' )],
219+ 2 => [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('Two ' )],
220+ 3 => [$ this ->identicalTo ('development ' ), $ this ->identicalTo ('Three ' )],
221+ };
222+ });
218223
219224 $ command ->setConfig ($ this ->config );
220225 $ command ->setManager ($ managerStub );
You can’t perform that action at this time.
0 commit comments