27 $refinery =
new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
29 $agent = $this->createMock(Setup\AgentCollection::class);
30 $config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
31 $agent_finder = $this->createMock(Setup\AgentFinder::class);
34 $tester =
new CommandTester($command);
36 $config = $this->createMock(Setup\ConfigCollection::class);
37 $config_file =
"config_file";
38 $config_file_content = [
"config_file"];
40 $objective = $this->createMock(Setup\Objective::class);
41 $env = $this->createMock(Setup\Environment::class);
43 $config_overwrites = [
49 ->expects($this->once())
54 ->expects($this->once())
55 ->method(
"readConfigFile")
56 ->with($config_file, $config_overwrites)
57 ->willReturn($config_file_content);
60 ->expects($this->once())
63 ->willReturn(
new class implements Setup\
Config {
71 ->expects($this->once())
77 ->expects($this->once())
78 ->method(
"getArrayToConfigTransformation")
80 ->willReturn($refinery->custom()->transformation(
function ($v) use ($config_file_content,
$config) {
81 $this->assertEquals($v, $config_file_content);
86 ->expects($this->once())
87 ->method(
"getInstallObjective")
89 ->willReturn($objective);
92 ->expects($this->never())
93 ->method(
"getBuildArtifactObjective")
98 ->expects($this->once())
99 ->method(
"getUpdateObjective")
104 ->expects($this->once())
105 ->method(
"getPreconditions")
108 $expects = $this->never();
111 if ($is_applicable) {
112 $expects = $this->once();
122 ->expects($this->once())
123 ->method(
"isApplicable")
124 ->willReturn($return);
127 "config" => $config_file,
128 "--config" => [
"a.b.c=foo",
"d.e=bar"]
134 $agent = $this->createMock(Setup\AgentCollection::class);
135 $config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
136 $agent_finder = $this->createMock(Setup\AgentFinder::class);
139 $tester =
new CommandTester($command);
141 $objective = $this->createMock(Setup\Objective::class);
142 $env = $this->createMock(Setup\Environment::class);
145 ->expects($this->once())
146 ->method(
"hasConfig")
150 ->expects($this->once())
151 ->method(
"getPluginAgent")
153 ->willReturn($agent);
156 ->expects($this->once())
157 ->method(
"getInstallObjective")
159 ->willReturn($objective);
162 ->expects($this->once())
163 ->method(
"getUpdateObjective")
168 ->expects($this->once())
169 ->method(
"getPreconditions")
173 ->expects($this->once())
178 ->expects($this->once())
179 ->method(
"isApplicable")
An objective is a desired state of the system that is supposed to be created by the setup...
basicFunctionality(bool $is_applicable)
A non-objective, nothing to do to achieve it...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testBasicFunctionalityAlreadyAchieved()
A configuration for the setup.