Skip to content

Commit 5380443

Browse files
author
Bastian Schwarz
committed
Replaced withConsecutive with ordered mockery call
1 parent 5eb02ba commit 5380443

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

test/task/media/PullTest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
use de\codenamephp\deployer\base\functions\iDownload;
2222
use de\codenamephp\deployer\base\task\media\Pull;
2323
use de\codenamephp\deployer\base\transferable\iTransferable;
24+
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
2425
use PHPUnit\Framework\TestCase;
2526

2627
final class PullTest extends TestCase {
2728

29+
use MockeryPHPUnitIntegration;
30+
2831
private Pull $sut;
2932

3033
protected function setUp() : void {
@@ -60,15 +63,10 @@ public function test__invoke() : void {
6063
$this->createConfiguredMock(iTransferable::class, ['getLocalPath' => 'local3', 'getRemotePath' => 'remote3', 'getConfig' => ['config3']]),
6164
);
6265

63-
$this->sut->deployerFunctions = $this->createMock(iDownload::class);
64-
$this->sut->deployerFunctions
65-
->expects(self::exactly(3))
66-
->method('download')
67-
->withConsecutive(
68-
['remote1', 'local1', ['config1']],
69-
['remote2', 'local2', ['config2']],
70-
['remote3', 'local3', ['config3']],
71-
);
66+
$this->sut->deployerFunctions = \Mockery::mock(iDownload::class);
67+
$this->sut->deployerFunctions->allows('download')->once()->ordered()->with('remote1', 'local1', ['config1']);
68+
$this->sut->deployerFunctions->allows('download')->once()->ordered()->with('remote2', 'local2', ['config2']);
69+
$this->sut->deployerFunctions->allows('download')->once()->ordered()->with('remote3', 'local3', ['config3']);
7270

7371
$this->sut->__invoke();
7472
}

0 commit comments

Comments
 (0)