ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLanguageSetupAgentTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
25 
31 {
35  protected $obj;
36 
37  protected function setUp() : void
38  {
39  $this->refinery = new Refinery($this->createMock(DataFactory::class), $this->createMock(\ilLanguage::class));
40  $setup_language = $this->createMock(\ilSetupLanguage::class);
41 
42  $this->obj = new \ilLanguageSetupAgent($this->refinery, null, $setup_language);
43  }
44 
45  public function testCreate() : void
46  {
47  $this->assertInstanceOf(\ilLanguageSetupAgent::class, $this->obj);
48  }
49 
50  public function testHasConfig() : void
51  {
52  $this->assertFalse($this->obj->hasConfig());
53  }
54 
55  public function testGetArrayToConfigTransformation() : void
56  {
57  $this->expectException(LogicException::class);
58 
59  $this->obj->getArrayToConfigTransformation();
60  }
61 
62  public function testGetInstallObjectives() : void
63  {
64  $objective_collection = $this->obj->getInstallObjective();
65 
66  $this->assertEquals('Complete objectives from Services/Language', $objective_collection->getLabel());
67  $this->assertFalse($objective_collection->isNotable());
68  $this->assertCount(2, $objective_collection->getObjectives());
69  }
70 
71  public function testGetUpdateObjective() : void
72  {
73  $objective_collection = $this->obj->getUpdateObjective();
74 
75  $this->assertEquals('Complete objectives from Services/Language', $objective_collection->getLabel());
76  $this->assertFalse($objective_collection->isNotable());
77  $this->assertCount(1, $objective_collection->getObjectives());
78  }
79 
80  public function testGetBuildArtifactObjective() : void
81  {
82  $result = $this->obj->getBuildArtifactObjective();
83 
84  $this->assertInstanceOf(NullObjective::class, $result);
85  }
86 }
Class ilLanguageBaseTest.
Class ilLanguageSetupAgentTest.