ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ILIAS\FileUpload\Collection\EntryLockingStringMapTest Class Reference

Class EntryLockingStringMapTest. More...

+ Inheritance diagram for ILIAS\FileUpload\Collection\EntryLockingStringMapTest:
+ Collaboration diagram for ILIAS\FileUpload\Collection\EntryLockingStringMapTest:

Public Member Functions

 setUp ()
 
 testPutValueWhichShouldSucceed ()
 
 testPutValueTwiceWhichShouldFail ()
 
 testGetWhichShouldSucceed ()
 
 testGetWithoutPutTheValueWhichShouldFail ()
 

Private Attributes

 $subject
 

Detailed Description

Class EntryLockingStringMapTest.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

disabled disabled disabled

Definition at line 20 of file EntryLockingStringMapTest.php.

Member Function Documentation

◆ setUp()

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::setUp ( )

Definition at line 31 of file EntryLockingStringMapTest.php.

32  {
33  $this->subject = new EntryLockingStringMap();
34  }

◆ testGetWhichShouldSucceed()

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::testGetWhichShouldSucceed ( )

Definition at line 68 of file EntryLockingStringMapTest.php.

References $key, and $result.

69  {
70  $key = "hello";
71  $value = "world";
72 
73  $this->subject->put($key, $value);
74  $result = $this->subject->get($key);
75 
76  $this->assertEquals($value, $result);
77  }
$result
$key
Definition: croninfo.php:18

◆ testGetWithoutPutTheValueWhichShouldFail()

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::testGetWithoutPutTheValueWhichShouldFail ( )

Definition at line 82 of file EntryLockingStringMapTest.php.

References $key.

83  {
84  $key = "hello";
85 
86  $this->setExpectedException(NoSuchElementException::class, "No meta data associated with key \"$key\".");
87  $this->subject->get($key);
88  }
$key
Definition: croninfo.php:18

◆ testPutValueTwiceWhichShouldFail()

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::testPutValueTwiceWhichShouldFail ( )

Definition at line 53 of file EntryLockingStringMapTest.php.

References $key.

54  {
55  $key = "hello";
56  $value = "world";
57 
58  $this->subject->put($key, $value);
59 
60  $this->setExpectedException(ElementAlreadyExistsException::class, "Element $key can not be overwritten.");
61 
62  $this->subject->put($key, $value);
63  }
$key
Definition: croninfo.php:18

◆ testPutValueWhichShouldSucceed()

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::testPutValueWhichShouldSucceed ( )

Definition at line 39 of file EntryLockingStringMapTest.php.

References $key, and $result.

40  {
41  $key = "hello";
42  $value = "world";
43  $this->subject->put($key, $value);
44  $result = $this->subject->toArray();
45 
46  $this->assertArrayHasKey($key, $result);
47  $this->assertEquals($value, $result[$key]);
48  }
$result
$key
Definition: croninfo.php:18

Field Documentation

◆ $subject

ILIAS\FileUpload\Collection\EntryLockingStringMapTest::$subject
private

Definition at line 26 of file EntryLockingStringMapTest.php.


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