ILIAS  release_8 Revision v8.24
ContentViewManagerTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
6
12class ContentViewManagerTest extends TestCase
13{
14 protected \ILIAS\Container\Content\ViewManager $manager;
15
16 protected function setUp(): void
17 {
18 parent::setUp();
19 if (!defined('ANONYMOUS_USER_ID')) {
20 define('ANONYMOUS_USER_ID', 13);
21 }
22 $view_repo = new \ILIAS\Container\Content\ViewSessionRepository();
23 $this->manager = new \ILIAS\Container\Content\ViewManager($view_repo, 5);
24 }
25
26 protected function tearDown(): void
27 {
28 }
29
33 public function testAdminView(): void
34 {
36
37 $manager->setAdminView();
38
39 $this->assertEquals(
40 true,
41 $manager->isAdminView()
42 );
43 $this->assertEquals(
44 false,
45 $manager->isContentView()
46 );
47 }
48
52 public function testContentView(): void
53 {
55
56 $manager->setContentView();
57
58 $this->assertEquals(
59 false,
60 $manager->isAdminView()
61 );
62 $this->assertEquals(
63 true,
64 $manager->isContentView()
65 );
66 }
67}
Test clipboard repository.
ILIAS Container Content ViewManager $manager
testContentView()
Test content view.