Unit tests for ilWebLinkParameter.
More...
◆ initDependencies()
ilWebResourceParameterTest::initDependencies |
( |
| ) |
|
|
protected |
Definition at line 30 of file ilWebResourceParameterTest.php.
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');
◆ testAppendToLink()
ilWebResourceParameterTest::testAppendToLink |
( |
| ) |
|
Definition at line 41 of file ilWebResourceParameterTest.php.
References $param, and ilWebLinkBaseParameter\VALUES.
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)
Immutable class for parameters attached to Web Link items.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
◆ testAppendToLinkException()
ilWebResourceParameterTest::testAppendToLinkException |
( |
| ) |
|
Definition at line 109 of file ilWebResourceParameterTest.php.
References $param.
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);
Immutable class for parameters attached to Web Link items.
◆ testGetInfo()
ilWebResourceParameterTest::testGetInfo |
( |
| ) |
|
Definition at line 193 of file ilWebResourceParameterTest.php.
References $param, and ilWebLinkBaseParameter\VALUES.
195 $user = $this->getMockBuilder(ilObjUser::class)
196 ->disableOriginalConstructor()
198 $user->expects($this->never())
199 ->method($this->anything());
209 $this->assertSame(
'name1=USER_ID',
$param->getInfo());
218 $this->assertSame(
'name2=LOGIN', $param->getInfo());
227 $this->assertSame(
'name3=MATRICULATION', $param->getInfo());
Immutable class for parameters attached to Web Link items.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
◆ testGetInfoException()
ilWebResourceParameterTest::testGetInfoException |
( |
| ) |
|
Definition at line 230 of file ilWebResourceParameterTest.php.
References $param.
232 $user = $this->getMockBuilder(ilObjUser::class)
233 ->disableOriginalConstructor()
235 $user->expects($this->never())
236 ->method($this->anything());
239 $this->expectException(ilWebLinkParameterException::class);
Immutable class for parameters attached to Web Link items.
◆ testToXML()
ilWebResourceParameterTest::testToXML |
( |
| ) |
|
Definition at line 123 of file ilWebResourceParameterTest.php.
References $param, and ilWebLinkBaseParameter\VALUES.
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'])
142 $writer->expects($this->exactly(3))
143 ->method(
'xmlElement')
144 ->willReturnCallback(fn($tag, $attrs) => match([$tag, $attrs]) {
145 [
'DynamicParameter', [
150 [
'DynamicParameter', [
155 [
'DynamicParameter', [
158 'type' =>
'matriculation' Immutable class for parameters attached to Web Link items.
const array VALUES
TODO Once the GUI is updated, undefined can be dropped.
The documentation for this class was generated from the following file: