ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ClipboardSessionRepositoryTest Class Reference

Test clipboard repository. More...

+ Inheritance diagram for ClipboardSessionRepositoryTest:
+ Collaboration diagram for ClipboardSessionRepositoryTest:

Public Member Functions

 testClear ()
 Test clear. More...
 
 testCmd ()
 Test cmd set/get. More...
 
 testRefIds ()
 Test ref ids set/get. More...
 
 testParent ()
 Test parent set/get. More...
 
 testHasEntriesNoCmd ()
 Test hasEntries returns false if ref ids, but no cmd is given. More...
 
 testHasEntriesCmd ()
 Test hasEntries returns true if ref ids and cmd is given. More...
 
 testHasEntriesCmdEmptyRefIds ()
 Test hasEntries returns false if empty ref ids array and cmd is given. More...
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

ILIAS Repository Clipboard ClipboardSessionRepository $clipboard
 

Detailed Description

Test clipboard repository.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 12 of file ClipboardSessionRepositoryTest.php.

Member Function Documentation

◆ setUp()

ClipboardSessionRepositoryTest::setUp ( )
protected

Definition at line 16 of file ClipboardSessionRepositoryTest.php.

16 : void
17 {
18 parent::setUp();
19 $this->clipboard = new \ILIAS\Repository\Clipboard\ClipboardSessionRepository();
20 $this->clipboard->clear();
21 }

◆ tearDown()

ClipboardSessionRepositoryTest::tearDown ( )
protected

Definition at line 23 of file ClipboardSessionRepositoryTest.php.

23 : void
24 {
25 }

◆ testClear()

ClipboardSessionRepositoryTest::testClear ( )

Test clear.

Definition at line 30 of file ClipboardSessionRepositoryTest.php.

30 : void
31 {
33 $clipboard->setCmd("test");
34 $clipboard->setRefIds([4]);
35 $clipboard->setParent(5);
36 $clipboard->clear();
37 $this->assertEquals(
38 "",
39 $clipboard->getCmd()
40 );
41 $this->assertEquals(
42 [],
43 $clipboard->getRefIds()
44 );
45 $this->assertEquals(
46 0,
47 $clipboard->getParent()
48 );
49 }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

References $clipboard.

◆ testCmd()

ClipboardSessionRepositoryTest::testCmd ( )

Test cmd set/get.

Definition at line 54 of file ClipboardSessionRepositoryTest.php.

54 : void
55 {
57 $clipboard->setCmd("test");
58 $this->assertEquals(
59 "test",
60 $clipboard->getCmd()
61 );
62 }

References $clipboard.

◆ testHasEntriesCmd()

ClipboardSessionRepositoryTest::testHasEntriesCmd ( )

Test hasEntries returns true if ref ids and cmd is given.

Definition at line 106 of file ClipboardSessionRepositoryTest.php.

106 : void
107 {
109 $clipboard->setRefIds([4]);
110 $clipboard->setCmd("cut");
111 $this->assertEquals(
112 true,
113 $clipboard->hasEntries()
114 );
115 }

References $clipboard.

◆ testHasEntriesCmdEmptyRefIds()

ClipboardSessionRepositoryTest::testHasEntriesCmdEmptyRefIds ( )

Test hasEntries returns false if empty ref ids array and cmd is given.

Definition at line 120 of file ClipboardSessionRepositoryTest.php.

120 : void
121 {
123 $clipboard->setRefIds([]);
124 $clipboard->setCmd("cut");
125 $this->assertEquals(
126 false,
127 $clipboard->hasEntries()
128 );
129 }

References $clipboard.

◆ testHasEntriesNoCmd()

ClipboardSessionRepositoryTest::testHasEntriesNoCmd ( )

Test hasEntries returns false if ref ids, but no cmd is given.

Definition at line 93 of file ClipboardSessionRepositoryTest.php.

93 : void
94 {
96 $clipboard->setRefIds([4]);
97 $this->assertEquals(
98 false,
99 $clipboard->hasEntries()
100 );
101 }

References $clipboard.

◆ testParent()

ClipboardSessionRepositoryTest::testParent ( )

Test parent set/get.

Definition at line 80 of file ClipboardSessionRepositoryTest.php.

80 : void
81 {
83 $clipboard->setParent(5);
84 $this->assertEquals(
85 5,
86 $clipboard->getParent()
87 );
88 }

References $clipboard.

◆ testRefIds()

ClipboardSessionRepositoryTest::testRefIds ( )

Test ref ids set/get.

Definition at line 67 of file ClipboardSessionRepositoryTest.php.

67 : void
68 {
70 $clipboard->setRefIds([4]);
71 $this->assertEquals(
72 [4],
73 $clipboard->getRefIds()
74 );
75 }

References $clipboard.

Field Documentation

◆ $clipboard

ILIAS Repository Clipboard ClipboardSessionRepository ClipboardSessionRepositoryTest::$clipboard
protected

The documentation for this class was generated from the following file: