77use de \codenamephp \deployer \command \Command ;
88use de \codenamephp \deployer \command \runConfiguration \SimpleContainer ;
99use de \codenamephp \deployer \flow \command \factory \WithBinaryFromDeployer ;
10+ use Mockery ;
11+ use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
1012use PHPUnit \Framework \TestCase ;
1113
1214final class WithBinaryFromDeployerTest extends TestCase {
1315
16+ use MockeryPHPUnitIntegration;
17+
1418 private WithBinaryFromDeployer $ sut ;
1519
1620 protected function setUp () : void {
@@ -30,15 +34,9 @@ public function test__construct() : void {
3034 public function testBuild () : void {
3135 $ runConfig = new SimpleContainer (123 );
3236
33- $ this ->sut ->deployer = $ this ->createMock (iGet::class);
34- $ this ->sut ->deployer
35- ->expects (self ::exactly (2 ))
36- ->method ('get ' )
37- ->withConsecutive (
38- ['flow:binary ' , '{{release_or_current_path}}/flow ' ],
39- ['flow:context ' , '' ]
40- )
41- ->willReturnOnConsecutiveCalls ('flow binary ' , 'flow context ' );
37+ $ this ->sut ->deployer = Mockery::mock (iGet::class);
38+ $ this ->sut ->deployer ->allows ('get ' )->once ()->ordered ()->with ('flow:binary ' , '{{release_or_current_path}}/flow ' )->andReturn ('flow binary ' );
39+ $ this ->sut ->deployer ->allows ('get ' )->once ()->ordered ()->with ('flow:context ' , '' )->andReturn ('flow context ' );
4240
4341 $ command = $ this ->sut ->build ('flow command ' , ['--some ' , '-arg ' ], ['FLOW_CONTEXT ' => 'some context ' , 'some ' => 'arg ' ], true , $ runConfig );
4442
@@ -51,15 +49,9 @@ public function testBuild() : void {
5149 }
5250
5351 public function testBuild_withMinimalArguments () : void {
54- $ this ->sut ->deployer = $ this ->createMock (iGet::class);
55- $ this ->sut ->deployer
56- ->expects (self ::exactly (2 ))
57- ->method ('get ' )
58- ->withConsecutive (
59- ['flow:binary ' , '{{release_or_current_path}}/flow ' ],
60- ['flow:context ' , '' ]
61- )
62- ->willReturnOnConsecutiveCalls (null , null );
52+ $ this ->sut ->deployer = Mockery::mock (iGet::class);
53+ $ this ->sut ->deployer ->allows ('get ' )->once ()->ordered ()->with ('flow:binary ' , '{{release_or_current_path}}/flow ' )->andReturn (null );
54+ $ this ->sut ->deployer ->allows ('get ' )->once ()->ordered ()->with ('flow:context ' , '' )->andReturn (null );
6355
6456 $ command = $ this ->sut ->build ('flow command ' );
6557
0 commit comments