ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
WorkspaceSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
26class WorkspaceSessionRepositoryTest extends TestCase
27{
28 protected function setUp(): void
29 {
30 parent::setUp();
31 }
32
33 protected function tearDown(): void
34 {
35 }
36
37 protected function getSessionRepo(): \ILIAS\PersonalWorkspace\WorkspaceSessionRepository
38 {
39 $repo = new \ILIAS\PersonalWorkspace\WorkspaceSessionRepository();
40 $repo->clearClipboard();
41 return $repo;
42 }
43
47 public function testClipboardCmd(): void
48 {
49 $repo = $this->getSessionRepo();
50 $repo->setClipboardCmd("cut");
51
52 $this->assertEquals(
53 "cut",
54 $repo->getClipboardCmd()
55 );
56 }
57
61 public function testSourceIds(): void
62 {
63 $repo = $this->getSessionRepo();
64 $repo->setClipboardSourceIds([4,6,7]);
65
66 $this->assertEquals(
67 [4,6,7],
68 $repo->getClipboardSourceIds()
69 );
70 }
71
75 public function testShared(): void
76 {
77 $repo = $this->getSessionRepo();
78 $repo->setClipboardShared(true);
79
80 $this->assertEquals(
81 true,
82 $repo->getClipboardShared()
83 );
84 }
85
86 public function testClear(): void
87 {
88 $repo = $this->getSessionRepo();
89 $repo->clearClipboard();
90
91 $this->assertEquals(
92 true,
93 $repo->isClipboardEmpty()
94 );
95 }
96
97 public function testNotEmpty(): void
98 {
99 $repo = $this->getSessionRepo();
100 $repo->clearClipboard();
101 $repo->setClipboardSourceIds([4,6,7]);
102 $repo->setClipboardCmd("cut");
103
104 $this->assertEquals(
105 false,
106 $repo->isClipboardEmpty()
107 );
108 }
109}
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.