ILIAS  release_7 Revision v7.30-3-g800a261c036
StatusCommandTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
8use PHPUnit\Framework\TestCase;
9use Symfony\Component\Console\Tester\CommandTester;
12use Hamcrest\Core\Set;
13
14class StatusCommandTest extends TestCase
15{
16 public function testMetrics() : void
17 {
18 $agent_finder = $this->createMock(Setup\AgentFinder::class);
19 $obj = new Setup\CLI\StatusCommand($agent_finder);
20 $storage = new Metrics\ArrayStorage();
21 $objective = $this->createMock(Setup\Objective::class);
22 $agent = $this->createMock(Setup\AgentCollection::class);
23 $expected = new M(M::STABILITY_MIXED, M::TYPE_COLLECTION, []);
24
25 $agent
26 ->expects($this->once())
27 ->method("getStatusObjective")
28 ->with($storage)
29 ->willReturn(new Setup\ObjectiveCollection("text", false, $objective));
30
31 $result = $obj->getMetrics($agent);
32
33 $this->assertEquals($expected, $result);
34 }
35}
$result
An exception for terminatinating execution or to throw for unit testing.
Command to output status information about the installation.
A metric is something we can measure about the system.
Definition: Metric.php:18
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...