Definition at line 63 of file AchieveCommandTest.php.
◆ setUp()
ILIAS\Tests\Setup\CLI\AchieveCommandTest::setUp |
( |
| ) |
|
Definition at line 85 of file AchieveCommandTest.php.
References ILIAS\Repository\refinery().
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));
90 $this->command =
new Setup\CLI\AchieveCommand($this->agent_finder, $this->config_reader, [], $this->
refinery);
◆ testAchieveObjective()
ILIAS\Tests\Setup\CLI\AchieveCommandTest::testAchieveObjective |
( |
| ) |
|
Definition at line 176 of file AchieveCommandTest.php.
References ILIAS\UI\examples\Layout\Page\Standard\$refinery, and null.
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);
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) {
227 $seen_config = $config;
229 "my.objective" =>
new Setup\ObjectiveConstructor(
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);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testBasicFunctionality()
ILIAS\Tests\Setup\CLI\AchieveCommandTest::testBasicFunctionality |
( |
| ) |
|
Definition at line 93 of file AchieveCommandTest.php.
References ILIAS\UI\examples\Layout\Page\Standard\$refinery.
95 $refinery =
new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
97 $agent = $this->createMock(Setup\AgentCollection::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);
139 "my.objective" =>
new Setup\ObjectiveConstructor(
141 static function () use ($objective): Setup\Objective {
142 return new Setup\ObjectiveCollection(
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
◆ $agent_finder
ILIAS\Tests\Setup\CLI\AchieveCommandTest::$agent_finder |
|
protected |
◆ $command
ILIAS\Tests\Setup\CLI\AchieveCommandTest::$command |
|
protected |
◆ $config_reader
ILIAS\Tests\Setup\CLI\AchieveCommandTest::$config_reader |
|
protected |
◆ $refinery
ILIAS\Tests\Setup\CLI\AchieveCommandTest::$refinery |
|
protected |
The documentation for this class was generated from the following file: