Skip to content

Commit d7eff35

Browse files
committed
update SeedRunTest
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
1 parent 83cf5ef commit d7eff35

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

tests/Phinx/Console/Command/SeedRunTest.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)