ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 28 of file ClipboardSessionRepositoryTest.php.

Member Function Documentation

◆ setUp()

ClipboardSessionRepositoryTest::setUp ( )
protected

Definition at line 32 of file ClipboardSessionRepositoryTest.php.

32  : void
33  {
34  parent::setUp();
35  $this->clipboard = new \ILIAS\Repository\Clipboard\ClipboardSessionRepository();
36  $this->clipboard->clear();
37  }

◆ tearDown()

ClipboardSessionRepositoryTest::tearDown ( )
protected

Definition at line 39 of file ClipboardSessionRepositoryTest.php.

39  : void
40  {
41  }

◆ testClear()

ClipboardSessionRepositoryTest::testClear ( )

Test clear.

Definition at line 46 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

46  : void
47  {
49  $clipboard->setCmd("test");
50  $clipboard->setRefIds([4]);
51  $clipboard->setParent(5);
52  $clipboard->clear();
53  $this->assertEquals(
54  "",
55  $clipboard->getCmd()
56  );
57  $this->assertEquals(
58  [],
59  $clipboard->getRefIds()
60  );
61  $this->assertEquals(
62  0,
63  $clipboard->getParent()
64  );
65  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testCmd()

ClipboardSessionRepositoryTest::testCmd ( )

Test cmd set/get.

Definition at line 70 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

70  : void
71  {
73  $clipboard->setCmd("test");
74  $this->assertEquals(
75  "test",
76  $clipboard->getCmd()
77  );
78  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testHasEntriesCmd()

ClipboardSessionRepositoryTest::testHasEntriesCmd ( )

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

Definition at line 122 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

122  : void
123  {
125  $clipboard->setRefIds([4]);
126  $clipboard->setCmd("cut");
127  $this->assertEquals(
128  true,
129  $clipboard->hasEntries()
130  );
131  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testHasEntriesCmdEmptyRefIds()

ClipboardSessionRepositoryTest::testHasEntriesCmdEmptyRefIds ( )

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

Definition at line 136 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

136  : void
137  {
139  $clipboard->setRefIds([]);
140  $clipboard->setCmd("cut");
141  $this->assertEquals(
142  false,
143  $clipboard->hasEntries()
144  );
145  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testHasEntriesNoCmd()

ClipboardSessionRepositoryTest::testHasEntriesNoCmd ( )

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

Definition at line 109 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

109  : void
110  {
112  $clipboard->setRefIds([4]);
113  $this->assertEquals(
114  false,
115  $clipboard->hasEntries()
116  );
117  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testParent()

ClipboardSessionRepositoryTest::testParent ( )

Test parent set/get.

Definition at line 96 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

96  : void
97  {
99  $clipboard->setParent(5);
100  $this->assertEquals(
101  5,
102  $clipboard->getParent()
103  );
104  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

◆ testRefIds()

ClipboardSessionRepositoryTest::testRefIds ( )

Test ref ids set/get.

Definition at line 83 of file ClipboardSessionRepositoryTest.php.

References $clipboard.

83  : void
84  {
86  $clipboard->setRefIds([4]);
87  $this->assertEquals(
88  [4],
89  $clipboard->getRefIds()
90  );
91  }
ILIAS Repository Clipboard ClipboardSessionRepository $clipboard

Field Documentation

◆ $clipboard

ILIAS Repository Clipboard ClipboardSessionRepository ClipboardSessionRepositoryTest::$clipboard
protected

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