3 declare(strict_types=1);
32 $user = $this->getMockBuilder(ilObjUser::class)
33 ->disableOriginalConstructor()
34 ->onlyMethods([
'getLogin',
'getId',
'getMatriculation'])
36 $user->method(
'getLogin')->willReturn(
'login');
37 $user->method(
'getId')->willReturn(37);
38 $user->method(
'getMatriculation')->willReturn(
'matriculation');
43 $user = $this->getMockBuilder(ilObjUser::class)
44 ->disableOriginalConstructor()
45 ->onlyMethods([
'getLogin',
'getId',
'getMatriculation'])
47 $user->method(
'getLogin')->willReturn(
'login');
48 $user->method(
'getId')->willReturn(37);
49 $user->method(
'getMatriculation')->willReturn(
'matriculation');
65 $param->appendToLink($link1)
69 $param->appendToLink($link2)
83 $param->appendToLink($link1)
87 $param->appendToLink($link2)
100 'link?name=matriculation',
101 $param->appendToLink($link1)
104 'li?nk&name=matriculation',
105 $param->appendToLink($link2)
111 $user = $this->getMockBuilder(ilObjUser::class)
112 ->disableOriginalConstructor()
114 $user->expects($this->never())
115 ->method($this->anything());
119 $this->expectException(ilWebLinkParameterException::class);
120 $param->appendToLink($link);
125 $user = $this->getMockBuilder(ilObjUser::class)
126 ->disableOriginalConstructor()
128 $user->expects($this->never())
129 ->method($this->anything());
131 $writer = $this->getMockBuilder(ilXmlWriter::class)
132 ->disableOriginalConstructor()
133 ->onlyMethods([
'xmlElement'])
135 $writer->expects($this->exactly(3))
136 ->method(
'xmlElement')
138 [
'DynamicParameter', [
143 [
'DynamicParameter', [
148 [
'DynamicParameter', [
151 'type' =>
'matriculation' 188 $user = $this->getMockBuilder(ilObjUser::class)
189 ->disableOriginalConstructor()
191 $user->expects($this->never())
192 ->method($this->anything());
202 $this->assertSame(
'name1=USER_ID',
$param->getInfo());
211 $this->assertSame(
'name2=LOGIN', $param->getInfo());
220 $this->assertSame(
'name3=MATRICULATION', $param->getInfo());
229 $this->assertSame(
'name4=SESSION_ID', $param->getInfo());
234 $user = $this->getMockBuilder(ilObjUser::class)
235 ->disableOriginalConstructor()
237 $user->expects($this->never())
238 ->method($this->anything());
241 $this->expectException(ilWebLinkParameterException::class);
testAppendToLinkException()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Unit tests for ilWebLinkParameter.
const VALUES
TODO Once the GUI is updated, undefined can be dropped.