ILIAS  release_8 Revision v8.25
WorkspaceSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
10class WorkspaceSessionRepositoryTest extends TestCase
11{
12 protected function setUp(): void
13 {
14 parent::setUp();
15 }
16
17 protected function tearDown(): void
18 {
19 }
20
21 protected function getSessionRepo(): \ILIAS\PersonalWorkspace\WorkspaceSessionRepository
22 {
23 $repo = new \ILIAS\PersonalWorkspace\WorkspaceSessionRepository();
24 $repo->clearClipboard();
25 return $repo;
26 }
27
31 public function testClipboardCmd(): void
32 {
33 $repo = $this->getSessionRepo();
34 $repo->setClipboardCmd("cut");
35
36 $this->assertEquals(
37 "cut",
38 $repo->getClipboardCmd()
39 );
40 }
41
45 public function testSourceIds(): void
46 {
47 $repo = $this->getSessionRepo();
48 $repo->setClipboardSourceIds([4,6,7]);
49
50 $this->assertEquals(
51 [4,6,7],
52 $repo->getClipboardSourceIds()
53 );
54 }
55
59 public function testShared(): void
60 {
61 $repo = $this->getSessionRepo();
62 $repo->setClipboardShared(true);
63
64 $this->assertEquals(
65 true,
66 $repo->getClipboardShared()
67 );
68 }
69
70 public function testClear(): void
71 {
72 $repo = $this->getSessionRepo();
73 $repo->clearClipboard();
74
75 $this->assertEquals(
76 true,
77 $repo->isClipboardEmpty()
78 );
79 }
80
81 public function testNotEmpty(): void
82 {
83 $repo = $this->getSessionRepo();
84 $repo->clearClipboard();
85 $repo->setClipboardSourceIds([4,6,7]);
86 $repo->setClipboardCmd("cut");
87
88 $this->assertEquals(
89 false,
90 $repo->isClipboardEmpty()
91 );
92 }
93}
Class ChatMainBarProvider \MainMenu\Provider.