ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
AgentTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
32 
33 require_once __DIR__ . '/../ContainerMock.php';
34 
35 class 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 }