ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilKSDocumentationGotoLinkTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once('vendor/composer/vendor/autoload.php');
22
23use PHPUnit\Framework\TestCase;
24
25class ilKSDocumentationGotoLinkTest extends TestCase
26{
28
29 protected function setUp(): void
30 {
31 $this->goto_link = new ilKSDocumentationGotoLink();
32 }
33
34 public function testConstruct(): void
35 {
36 $this->assertInstanceOf(ilKSDocumentationGotoLink::class, $this->goto_link);
37 }
38
39 public function testGenerateGotoLink(): void
40 {
41 $link = $this->goto_link->generateGotoLink('nodeId', 'skinId', 'styleId');
42 $this->assertEquals('nodeId/skinId/styleId', $link);
43 }
44
45 public function testRedirectWithGotoLink(): void
46 {
47 $ctrl_observer = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
48 'setParameterByClass',
49 'setTargetScript',
50 'getLinkTargetByClass'
51 ])->getMock();
52
53
54 $ctrl_observer->expects($this->once())
55 ->method('getLinkTargetByClass')
56 ->with([
57 'ilAdministrationGUI',
58 'ilObjStyleSettingsGUI',
59 'ilSystemStyleMainGUI',
60 'ilSystemStyleDocumentationGUI'
61 ], 'entries');
62
63 $params = ['something', 'something', 'something', 'nodeId', 'skinId', 'styleId'];
64 $this->goto_link->generateRedirectURL($ctrl_observer, 1, $params[3], $params[4], $params[5]);
65 }
66}
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31