ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TestCase.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Tests\Refinery;
22
25use PHPUnit\Framework\TestCase as PHPUnitTestCase;
26
27class 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
58abstract 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
loadLanguageModule(string $a_module)
Definition: TestCase.php:48
txt(string $a_topic, string $a_default_lang_fallback_mod='')
Definition: TestCase.php:38