ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWebResourceItemExternalTest Class Reference

Unit tests for ilWebLinkItemExternal. More...

+ Inheritance diagram for ilWebResourceItemExternalTest:
+ Collaboration diagram for ilWebResourceItemExternalTest:

Public Member Functions

 testGetResolvedLink ()
 

Detailed Description

Unit tests for ilWebLinkItemExternal.

Author
Tim Schmitz schmi.nosp@m.tz@l.nosp@m.eifos.nosp@m..com

Definition at line 27 of file ilWebResourceItemExternalTest.php.

Member Function Documentation

◆ testGetResolvedLink()

ilWebResourceItemExternalTest::testGetResolvedLink ( )

Definition at line 29 of file ilWebResourceItemExternalTest.php.

References null.

29  : void
30  {
31  $param1 = $this->getMockBuilder(ilWebLinkParameter::class)
32  ->disableOriginalConstructor()
33  ->onlyMethods(['appendToLink', 'getValue'])
34  ->getMock();
35  $param1->expects($this->once())
36  ->method('appendToLink')
37  ->with('target')
38  ->willReturn('target?param1');
39  $param1->expects($this->any())
40  ->method('getValue')
41  ->willReturn(1);
42 
43 
44  $param2 = $this->getMockBuilder(ilWebLinkParameter::class)
45  ->disableOriginalConstructor()
46  ->onlyMethods(['appendToLink', 'getValue'])
47  ->getMock();
48  $param2->expects($this->once())
49  ->method('appendToLink')
50  ->with('target?param1')
51  ->willReturn('target?param1&param2');
52  $param2->expects($this->any())
53  ->method('getValue')
54  ->willReturn(1);
55 
56  $item = new ilWebLinkItemExternal(
57  0,
58  1,
59  'title',
60  null,
61  'target',
62  true,
63  new DateTimeImmutable(),
64  new DateTimeImmutable(),
65  [$param1, $param2]
66  );
67 
68  $this->assertSame(
69  'target?param1&param2',
70  $item->getResolvedLink(true)
71  );
72  $this->assertSame(
73  'target',
74  $item->getResolvedLink(false)
75  );
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Immutable class for external Web Link items.

The documentation for this class was generated from the following file: