ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ExtLinkMapperTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
26
28{
29 public function testGetRefId(): void
30 {
31 $def_mock = $this->getMockBuilder(\ilObjectDefinition::class)
32 ->disableOriginalConstructor()
33 ->getMock();
34 $def_mock
35 ->method('isRBACObject')
36 ->willReturn(true);
37
38 $ext_link_mapper = new ExtLinkMapper(
39 $def_mock,
40 "http://localhost/ilias",
41 [3 => 5],
42 "client"
43 );
44
45 $ref_id = $ext_link_mapper->getRefId("http://localhost/ilias/goto.php/file/231");
46 $this->assertEquals(
47 231,
49 );
50
51 $ref_id = $ext_link_mapper->getRefId("http://localhost/ilias/goto_client_cat_581.html");
52 $this->assertEquals(
53 581,
55 );
56
57 $ref_id = $ext_link_mapper->getRefId("http://localhost/ilias/go/file/33");
58 $this->assertEquals(
59 33,
61 );
62
63 $ref_id = $ext_link_mapper->getRefId("http://localhost/ilias/ilias.php?baseClass=ilrepositorygui&ref_id=198");
64 $this->assertEquals(
65 198,
67 );
68 }
69}
$ref_id
Definition: ltiauth.php:66