ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StatusCommandTest.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;
28use Hamcrest\Core\Set;
29
30class StatusCommandTest extends TestCase
31{
32 public function testMetrics(): void
33 {
34 $agent_finder = $this->createMock(Setup\AgentFinder::class);
35 $obj = new Setup\CLI\StatusCommand($agent_finder);
36 $storage = new Metrics\ArrayStorage();
37 $objective = $this->createMock(Setup\Objective::class);
38 $agent = $this->createMock(Setup\AgentCollection::class);
39 $expected = new M(M::STABILITY_MIXED, M::TYPE_COLLECTION, []);
40
41 $agent
42 ->expects($this->once())
43 ->method("getStatusObjective")
44 ->with($storage)
45 ->willReturn(new Setup\ObjectiveCollection("text", false, $objective));
46
47 $result = $obj->getMetrics($agent);
48
49 $this->assertEquals($expected, $result);
50 }
51}
Command to output status information about the installation.
A metric is something we can measure about the system.
Definition: Metric.php:34
A objective collection is a objective that is achieved once all subobjectives are achieved.
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...