|
21 | 21 | use de\codenamephp\deployer\base\functions\iDownload; |
22 | 22 | use de\codenamephp\deployer\base\task\media\Pull; |
23 | 23 | use de\codenamephp\deployer\base\transferable\iTransferable; |
| 24 | +use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; |
24 | 25 | use PHPUnit\Framework\TestCase; |
25 | 26 |
|
26 | 27 | final class PullTest extends TestCase { |
27 | 28 |
|
| 29 | + use MockeryPHPUnitIntegration; |
| 30 | + |
28 | 31 | private Pull $sut; |
29 | 32 |
|
30 | 33 | protected function setUp() : void { |
@@ -60,15 +63,10 @@ public function test__invoke() : void { |
60 | 63 | $this->createConfiguredMock(iTransferable::class, ['getLocalPath' => 'local3', 'getRemotePath' => 'remote3', 'getConfig' => ['config3']]), |
61 | 64 | ); |
62 | 65 |
|
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']); |
72 | 70 |
|
73 | 71 | $this->sut->__invoke(); |
74 | 72 | } |
|
0 commit comments