ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilKSDocumentationGotoLinkTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once('libs/composer/vendor/autoload.php');
22 
24 
25 class 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  'redirectByClass'
51  ])->getMock();
52 
53  $ctrl_observer->expects($this->once())
54  ->method('redirectByClass')
55  ->with([
56  'ilAdministrationGUI',
57  'ilObjStyleSettingsGUI',
58  'ilSystemStyleMainGUI',
59  'ilSystemStyleDocumentationGUI'
60  ], 'entries');
61 
62  $params = ['something', 'something', 'nodeId', 'skinId', 'styleId'];
63  $this->goto_link->redirectWithGotoLink('ref_id', $params, $ctrl_observer);
64  }
65 }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33