19 declare(strict_types=1);
31 protected function setUp(): void
33 $lng = $this->createMock(\ilLanguage::class);
34 $lng->expects(self::once())->method(
'loadLanguageModule')->with(
'meta');
35 $map = [
'key1' =>
'text',
'key2' =>
'text with %s'];
36 $lng->method(
'txt')->willReturnCallback(
function ($arg) use ($map) {
37 return $map[$arg] ??
'';
39 $lng->method(
'exists')->willReturnCallback(
function ($arg) use ($map) {
40 return key_exists($arg, $map);
43 $this->format = $this->createMock(DateFormat::class);
44 $user = $this->createMock(\ilObjUser::class);
45 $user->method(
'getDateFormat')->willReturn($this->format);
54 $this->utilities->getUserDateFormat()
62 $this->utilities->txt(
'key1')
70 $this->utilities->txtFill(
'key1',
'more text')
73 'text with more text',
74 $this->utilities->txtFill(
'key2',
'more text')
77 'wrong key first, second',
78 $this->utilities->txtFill(
'wrong key',
'first',
'second')