ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AgentTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28use ILIAS\LegalDocuments\test\ContainerMock;
30use PHPUnit\Framework\TestCase;
32
33require_once __DIR__ . '/../ContainerMock.php';
34
35class AgentTest extends TestCase
36{
37 use ContainerMock;
38
39 public function testConstruct(): void
40 {
41 $this->assertInstanceOf(Agent::class, new Agent($this->mock(Refinery::class)));
42 }
43
44 public function testHasConfig(): void
45 {
46 $this->assertFalse((new Agent($this->mock(Refinery::class)))->hasConfig());
47 }
48
49 public function testGetArrayToConfigTransformation(): void
50 {
51 $identity = $this->mock(Transformation::class);
52 $this->assertSame($identity, (new Agent($this->mockTree(Refinery::class, ['identity' => $identity])))->getArrayToConfigTransformation());
53 }
54
55 public function testGetInstallObjective(): void
56 {
57 $this->assertInstanceOf(NullObjective::class, (new Agent($this->mock(Refinery::class)))->getInstallObjective());
58 }
59
60 public function testGetUpdateObjective(): void
61 {
62 $this->assertInstanceOf(ilDatabaseUpdateStepsExecutedObjective::class, (new Agent($this->mock(Refinery::class)))->getUpdateObjective());
63 }
64
65 public function testGetBuildArtifactObjective(): void
66 {
67 $this->assertInstanceOf(ConsumerObjective::class, (new Agent($this->mock(Refinery::class)))->getBuildObjective());
68 }
69
70 public function testGetStatusObjective(): void
71 {
72 $this->assertInstanceOf(\ilDatabaseUpdateStepsMetricsCollectedObjective::class, (new Agent($this->mock(Refinery::class)))->getStatusObjective($this->mock(Storage::class)));
73 }
74
75 public function testGetMigrations(): void
76 {
77 $this->assertSame([], (new Agent($this->mock(Refinery::class)))->getMigrations());
78 }
79
80 public function testGetNamedObjectives(): void
81 {
82 $this->assertSame([], (new Agent($this->mock(Refinery::class)))->getNamedObjectives());
83 }
84}
Builds data types.
Definition: Factory.php:36
A non-objective, nothing to do to achieve it...
This class attempt to achieve a set of database update steps.
A transformation is a function from one datatype to another.