19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
32 $user = $this->createStub(ilObjUser::class);
33 $user->method(
'getLogin')->willReturn(
'login');
34 $user->method(
'getId')->willReturn(37);
35 $user->method(
'getMatriculation')->willReturn(
'matriculation');
40 $user = $this->createStub(ilObjUser::class);
41 $user->method(
'getLogin')->willReturn(
'login');
42 $user->method(
'getId')->willReturn(37);
43 $user->method(
'getMatriculation')->willReturn(
'matriculation');
59 $param->appendToLink($link1)
63 $param->appendToLink($link2)
77 $param->appendToLink($link1)
81 $param->appendToLink($link2)
94 'link?name=matriculation',
95 $param->appendToLink($link1)
98 'li?nk&name=matriculation',
99 $param->appendToLink($link2)
105 $user = $this->createMock(ilObjUser::class);
106 $user->expects($this->never())
107 ->method($this->anything());
111 $this->expectException(ilWebLinkParameterException::class);
112 $param->appendToLink($link);
117 $user = $this->createMock(ilObjUser::class);
118 $user->expects($this->never())
119 ->method($this->anything());
121 $writer = $this->createMock(ilXmlWriter::class);
129 $writer->expects($this->exactly(3))
130 ->method(
'xmlElement')
131 ->willReturnCallback(fn($tag, $attrs) => match([$tag, $attrs]) {
132 [
'DynamicParameter', [
137 [
'DynamicParameter', [
142 [
'DynamicParameter', [
145 'type' =>
'matriculation'
182 $user = $this->createMock(ilObjUser::class);
183 $user->expects($this->never())
184 ->method($this->anything());
194 $this->assertSame(
'name1=USER_ID',
$param->getInfo());
203 $this->assertSame(
'name2=LOGIN',
$param->getInfo());
212 $this->assertSame(
'name3=MATRICULATION',
$param->getInfo());
217 $user = $this->createMock(ilObjUser::class);
218 $user->expects($this->never())
219 ->method($this->anything());
222 $this->expectException(ilWebLinkParameterException::class);
Customizing of pimple-DIC for ILIAS.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
Immutable class for parameters attached to Web Link items.
Unit tests for ilWebLinkParameter.
testAppendToLinkException()