ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
TestCase.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Tests\Refinery;
22
26use PHPUnit\Framework\TestCase as PHPUnitTestCase;
27
28class ilLanguageMock implements Language
29{
31 public array $requested = [];
32 public string $lang_key = 'en';
33
34 public function __construct()
35 {
36 }
37
38 public function txt(string|LanguageIdentifier $a_topic, ?int $n = null): string
39 {
40 $this->requested[] = $a_topic;
41 return \is_string($a_topic) ? $a_topic : (string) $a_topic->value;
42 }
43
44 public function toJS($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}
loadLanguageModule(string $a_module)
Definition: TestCase.php:48
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
$n selects a plural form, e.g.
Definition: TestCase.php:38
toJS($key, ?ilGlobalTemplateInterface $a_tpl=null)
Definition: TestCase.php:44
A language identifier as an enum case (backing value = identifier), generated per module from its ....