3 declare(strict_types=1);
87 $this->config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
88 $this->agent_finder = $this->createMock(Setup\AgentFinder::class);
89 $this->
refinery =
new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
95 $refinery =
new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
97 $agent = $this->createMock(Setup\AgentCollection::class);
98 $config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
99 $agent_finder = $this->createMock(Setup\AgentFinder::class);
102 $tester =
new CommandTester($command);
104 $config = $this->createMock(Setup\ConfigCollection::class);
105 $config_file =
"config_file";
106 $config_file_content = [
"config_file"];
107 $objective_name =
"my.objective";
109 $objective = $this->createMock(Setup\Objective::class);
110 $env = $this->createMock(Setup\Environment::class);
113 ->expects($this->once())
114 ->method(
"readConfigFile")
116 ->willReturn($config_file_content);
119 ->expects($this->once())
120 ->method(
"getAgents")
122 ->willReturn($agent);
125 ->expects($this->once())
126 ->method(
"hasConfig")
130 ->expects($this->once())
131 ->method(
"getArrayToConfigTransformation")
133 ->willReturn(
$refinery->custom()->transformation(
function ($v) use ($config_file_content,
$config) {
134 $this->assertEquals($v, $config_file_content);
141 static function () use ($objective): Setup\
Objective {
152 ->expects($this->once())
153 ->method(
"getNamedObjectives")
154 ->willReturn($namedObjectives);
157 ->expects($this->once())
158 ->method(
"getPreconditions")
162 ->method(
"isApplicable")
166 ->expects($this->once())
171 "config" => $config_file,
172 "objective" => $objective_name
178 $refinery =
new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
180 $agent = $this->createMock(Setup\AgentCollection::class);
181 $config_reader = $this->createMock(Setup\CLI\ConfigReader::class);
182 $agent_finder = $this->createMock(Setup\AgentFinder::class);
185 $tester =
new CommandTester($command);
187 $config = $this->createMock(Setup\ConfigCollection::class);
188 $config_file =
"config_file";
189 $config_file_content = [
"config_file"];
190 $objective_name =
"my.objective";
192 $objective = $this->createMock(Setup\Objective::class);
193 $env = $this->createMock(Setup\Environment::class);
196 ->expects($this->once())
197 ->method(
"readConfigFile")
199 ->willReturn($config_file_content);
202 ->expects($this->once())
203 ->method(
"getAgents")
205 ->willReturn($agent);
208 ->expects($this->once())
209 ->method(
"hasConfig")
213 ->expects($this->once())
214 ->method(
"getArrayToConfigTransformation")
216 ->willReturn(
$refinery->custom()->transformation(
function ($v) use ($config_file_content,
$config) {
217 $this->assertEquals($v, $config_file_content);
224 ->expects($this->once())
225 ->method(
"getNamedObjectives")
226 ->will($this->returnCallback(
function (
$config) use (&$seen_config, $objective) {
231 static function () use ($objective): Setup\
Objective {
239 ->expects($this->once())
240 ->method(
"getPreconditions")
244 ->method(
"isApplicable")
248 ->expects($this->once())
253 "config" => $config_file,
254 "objective" => $objective_name
257 $this->assertSame($seen_config,
$config);
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A agent is some component that performs part of the setup process.
readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field=null)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A configuration for the setup.
A collection of some configurations.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery