ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
BuildCommandTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Tests\Setup\CLI;
22
23use ILIAS\Setup;
24use PHPUnit\Framework\TestCase;
25use Symfony\Component\Console\Tester\CommandTester;
26
27class BuildCommandTest extends TestCase
28{
29 public function testBasicFunctionality(): void
30 {
31 $agent_finder = $this->createMock(Setup\AgentFinder::class);
32
33 $agent = $this->createMock(Setup\AgentCollection::class);
34 $agent_finder
35 ->expects($this->once())
36 ->method("getAgents")
37 ->with()
38 ->willReturn($agent);
39
40 $objective = $this->createMock(Setup\Objective::class);
41 $agent
42 ->expects($this->once())
43 ->method("getBuildObjective")
44 ->with()
45 ->willReturn($objective);
46
47 $objective
48 ->expects($this->once())
49 ->method("getPreconditions")
50 ->willReturn([]);
51
52 $objective
53 ->expects($this->once())
54 ->method("achieve")
55 ->will($this->returnCallback(function (Setup\Environment $e) {
56 return $e;
57 }));
58
59 $objective
60 ->expects($this->once())
61 ->method("isApplicable")
62 ->willReturn(true);
63
64 $command = new Setup\CLI\BuildCommand($agent_finder);
65 $tester = new CommandTester($command);
66 $tester->execute([]);
67 }
68}
Installation command.
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...