ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
BuildArtifactsCommandTest.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
6 
7 use ILIAS\Setup;
11 
12 class BuildArtifactsCommandTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testBasicFunctionality()
15  {
16  $refinery = new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
17 
18  $agent = $this->createMock(Setup\Agent::class);
19  $config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
20  $command = new Setup\CLI\BuildArtifactsCommand(function () use ($agent) {
21  return $agent;
22  }, $config_reader, []);
23 
24  $tester = new CommandTester($command);
25 
26  $objective = $this->createMock(Setup\Objective::class);
27  $env = $this->createMock(Setup\Environment::class);
28 
29  $agent
30  ->expects($this->once())
31  ->method("getBuildArtifactObjective")
32  ->with()
33  ->willReturn($objective);
34 
35  $objective
36  ->expects($this->once())
37  ->method("getPreconditions")
38  ->willReturn([]);
39 
40  $objective
41  ->expects($this->once())
42  ->method("achieve")
43  ->willReturn($env);
44 
45  $tester->execute([
46  ]);
47  }
48 }