ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ContentModeManagerTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
12 class ContentModeManagerTest extends TestCase
13 {
14  protected \ILIAS\Container\Content\ViewManager $manager;
15 
16  protected function setUp(): void
17  {
18  parent::setUp();
19  $view_repo = new \ILIAS\Container\Content\ModeSessionRepository();
20  $this->manager = new \ILIAS\Container\Content\ModeManager($view_repo);
21  }
22 
23  protected function tearDown(): void
24  {
25  }
26 
30  public function testAdminView(): void
31  {
32  $manager = $this->manager;
33 
34  $manager->setAdminMode();
35 
36  $this->assertEquals(
37  true,
38  $manager->isAdminMode()
39  );
40  $this->assertEquals(
41  false,
42  $manager->isContentMode()
43  );
44  }
45 
49  public function testContentView(): void
50  {
51  $manager = $this->manager;
52 
53  $manager->setContentMode();
54 
55  $this->assertEquals(
56  false,
57  $manager->isAdminMode()
58  );
59  $this->assertEquals(
60  true,
61  $manager->isContentMode()
62  );
63  }
64 }
Test clipboard repository.
ILIAS Container Content ViewManager $manager
testContentView()
Test content view.
testAdminView()
Test admin view.