ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSetupLanguageTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
29 
33  private array $langInstalled;
34 
35  protected function setUp(): void
36  {
37  $this->newLangSetupDe = new ilSetupLanguage('de');
38  $this->newLangSetupEs = new ilSetupLanguage('es');
39 
40  $this->langInstalled[] = $this->newLangSetupDe;
41  $this->langInstalled[] = $this->newLangSetupEs;
42  }
43 
44  public function testRetrieveLanguageKey(): void
45  {
46  $this->assertEquals('de', $this->newLangSetupDe->getLangKey());
47  $this->assertEquals('es', $this->newLangSetupEs->getLangKey());
48  }
49 
50  public function testRetrieveInstalledLanguage(): void
51  {
52  $languagesAsKeys = [];
53  foreach ($this->langInstalled as $languageAsKey) {
54  $languagesAsKeys[] = $languageAsKey->getLangKey();
55  }
56 
57  $this->assertContains('de', $languagesAsKeys);
58  $this->assertContains('es', $languagesAsKeys);
59  }
60 }
ilSetupLanguage $newLangSetupDe
language handling for setup
Class ilLanguageBaseTest.
Class ilSetupLanguageTest.
ilSetupLanguage $newLangSetupEs