ILIAS  trunk Revision v11.0_alpha-1838-g59fc79e306b
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TestCase.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Tests\Refinery;
22 
26 
27 class ilLanguageMock implements Language
28 {
30  public array $requested = [];
31  public string $lang_module = 'common';
32  public string $lang_key = 'en';
33 
34  public function __construct()
35  {
36  }
37 
38  public function txt(string $a_topic, string $a_default_lang_fallback_mod = ''): string
39  {
40  $this->requested[] = $a_topic;
41  return $a_topic;
42  }
43 
44  public function toJS($a_lang_key, ?ilGlobalTemplateInterface $a_tpl = null): void
45  {
46  }
47 
48  public function loadLanguageModule(string $a_module): void
49  {
50  }
51 
52  public function getLangKey(): string
53  {
54  return $this->lang_key;
55  }
56 }
57 
58 abstract class TestCase extends PHPUnitTestCase
59 {
60  public function getLanguage(): Language
61  {
62  return new ilLanguageMock();
63  }
64 }
toJS($a_lang_key, ?ilGlobalTemplateInterface $a_tpl=null)
Definition: TestCase.php:44
txt(string $a_topic, string $a_default_lang_fallback_mod='')
Definition: TestCase.php:38
loadLanguageModule(string $a_module)
Definition: TestCase.php:48
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null