ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLanguageSetupAgentTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use LogicException;
28 
29 class ilLanguageSetupAgentTest extends TestCase
30 {
34  protected $obj;
35 
36  public function setUp(): void
37  {
38  $refinery = new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
39  $setup_language = $this->createMock(\ilSetupLanguage::class);
40 
41  $this->obj = new \ilLanguageSetupAgent($refinery, null, $setup_language);
42  }
43 
44  public function testCreate(): void
45  {
46  $this->assertInstanceOf(\ilLanguageSetupAgent::class, $this->obj);
47  }
48 
49  public function testHasConfig(): void
50  {
51  $this->assertFalse($this->obj->hasConfig());
52  }
53 
54  public function testGetArrayToConfigTransformation(): void
55  {
56  $this->expectException(LogicException::class);
57 
58  $fnc = $this->obj->getArrayToConfigTransformation();
59  }
60 
61  public function testGetInstallObjectives(): void
62  {
63  $objective_collection = $this->obj->getInstallObjective();
64 
65  $this->assertEquals('Complete objectives from Services/Language', $objective_collection->getLabel());
66  $this->assertFalse($objective_collection->isNotable());
67  $this->assertCount(2, $objective_collection->getObjectives());
68  }
69 
70  public function testGetUpdateObjective(): void
71  {
72  $objective_collection = $this->obj->getUpdateObjective();
73 
74  $this->assertEquals('Complete objectives from Services/Language', $objective_collection->getLabel());
75  $this->assertFalse($objective_collection->isNotable());
76  $this->assertCount(1, $objective_collection->getObjectives());
77  }
78 
79  public function testGetBuildArtifactObjective(): void
80  {
81  $result = $this->obj->getBuildArtifactObjective();
82 
83  $this->assertInstanceOf(NullObjective::class, $result);
84  }
85 }
Refinery Factory $refinery