19 declare(strict_types=1);
31 require_once __DIR__ .
'/../ContainerMock.php';
39 $this->assertInstanceOf(UI::class,
new UI(
'foo', $this->mock(UIServices::class), $this->mock(ilLanguage::class)));
44 $ui_factory = $this->mock(UIFactory::class);
45 $this->assertSame($ui_factory, (
new UI(
'foo', $this->mockTree(UIServices::class, [
'factory' => $ui_factory]), $this->mock(ilLanguage::class)))->create());
50 $template = $this->mock(ilGlobalTemplateInterface::class);
51 $this->assertSame($template, (
new UI(
'foo', $this->mockTree(UIServices::class, [
'mainTemplate' => $template]), $this->mock(ilLanguage::class)))->
mainTemplate());
56 $language = $this->mockMethod(ilLanguage::class,
'txt', [
'ldoc_foo'],
'baz');
62 ->expects(self::exactly(2))
65 function (
string $txt) use (&$consecutive) {
66 [$expected, $return] = array_shift($consecutive);
67 $this->assertEquals($expected, $txt);
71 $instance =
new UI(
'bar', $this->mock(UIServices::class), $language);
72 $this->assertSame(
'baz', $instance->txt(
'foo'));
77 $consecutive = [
'bar_foo',
'ldoc_foo'];
78 $language = $this->mockMethod(ilLanguage::class,
'txt', [
'foo'],
'baz');
80 ->expects(self::exactly(2))
83 function (
string $txt) use (&$consecutive) {
84 $this->assertEquals(array_shift($consecutive), $txt);
89 $instance =
new UI(
'bar', $this->mock(UIServices::class), $language);
90 $this->assertSame(
'baz', $instance->txt(
'foo'));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...