ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NullAgentTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use PHPUnit\Framework\TestCase;
27
28class NullAgentTest extends TestCase
29{
30 protected \ILIAS\Refinery\Factory $refinery;
32 protected NullAgent $agent;
33
34 public function setUp(): void
35 {
36 $this->refinery = $this->createMock(\ILIAS\Refinery\Factory::class);
37 $this->storage = $this->createMock(Metrics\Storage::class);
38 $this->agent = new NullAgent($this->refinery);
39 }
40
41 public function testIsNull(): void
42 {
43 $null = new NullObjective();
44 $this->assertFalse($this->agent->hasConfig());
45 $this->assertEquals($null, $this->agent->getInstallObjective());
46 $this->assertEquals($null, $this->agent->getUpdateObjective());
47 $this->assertEquals($null, $this->agent->getBuildObjective());
48 $this->assertEquals($null, $this->agent->getStatusObjective($this->storage));
49 $this->assertEquals([], $this->agent->getMigrations());
50 }
51
53 {
54 $this->expectException(\LogicException::class);
55 $this->agent->getArrayToConfigTransformation();
56 }
57}
An agent that just doesn't do a thing.
Definition: NullAgent.php:35
A non-objective, nothing to do to achieve it...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.