File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818namespace de \codenamephp \deployer \command \runner ;
1919
20+ use de \codenamephp \deployer \base \functions \All ;
2021use de \codenamephp \deployer \base \functions \iRun ;
2122use de \codenamephp \deployer \command \iCommand ;
2223
2526 */
2627final class WithDeployerFunctions implements iRunner {
2728
28- public function __construct (public iRun $ deployerFunction ) {}
29+ public function __construct (public iRun $ deployerFunction = new All () ) {}
2930
3031 public function run (iCommand $ command ) : string {
3132 return $ this ->deployerFunction ->run ($ command ->__toString (), $ command ->getRunConfiguration ()->getOptions ());
Original file line number Diff line number Diff line change 1717
1818namespace de \codenamephp \deployer \command \test \runner ;
1919
20+ use de \codenamephp \deployer \base \functions \All ;
2021use de \codenamephp \deployer \base \functions \iRun ;
2122use de \codenamephp \deployer \command \iCommand ;
2223use de \codenamephp \deployer \command \runConfiguration \iRunConfiguration ;
@@ -43,6 +44,12 @@ public function test__construct() : void {
4344 self ::assertSame ($ deployerFunction , $ this ->sut ->deployerFunction );
4445 }
4546
47+ public function test__construct_withoutArguments () : void {
48+ $ this ->sut = new WithDeployerFunctions ();
49+
50+ self ::assertInstanceOf (All::class, $ this ->sut ->deployerFunction );
51+ }
52+
4653 public function testRun () : void {
4754 $ runConfiguration = $ this ->createMock (iRunConfiguration::class);
4855 $ runConfiguration ->expects (self ::once ())->method ('getOptions ' )->willReturn (['some ' => 'options ' ]);
You can’t perform that action at this time.
0 commit comments