ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ProvidePublicPageTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use ilCtrl;
27 use ilStartUpGUI;
28 
29 require_once __DIR__ . '/../ContainerMock.php';
30 
31 class ProvidePublicPageTest extends TestCase
32 {
33  use ContainerMock;
34 
35  public function testConstruct(): void
36  {
37  $this->assertInstanceOf(ProvidePublicPage::class, new ProvidePublicPage('foo', $this->mock(ilCtrl::class)));
38  }
39 
40  public function testUrl(): void
41  {
42  $ctrl = $this->mock(ilCtrl::class);
43  $ctrl->expects(self::exactly(2))->method('setParameterByClass')->withConsecutive([ilStartUpGUI::class, 'id', 'foo'], [ilStartUpGUI::class, 'id', '']);
44  $ctrl->expects(self::once())->method('getLinkTargetByClass')->with(ilStartUpGUI::class, 'showLegalDocuments')->willReturn('url');
45 
46  $instance = new ProvidePublicPage('foo', $ctrl);
47  $this->assertSame('url', $instance->url());
48  }
49 }