ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 21 of file EntryLockingStringMapTest.php.

Member Function Documentation

◆ setUp()

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

Definition at line 32 of file EntryLockingStringMapTest.php.

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

◆ testGetWhichShouldSucceed()

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

Definition at line 70 of file EntryLockingStringMapTest.php.

References $result.

71  {
72  $key = "hello";
73  $value = "world";
74 
75  $this->subject->put($key, $value);
76  $result = $this->subject->get($key);
77 
78  $this->assertEquals($value, $result);
79  }
$result

◆ testGetWithoutPutTheValueWhichShouldFail()

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

Definition at line 84 of file EntryLockingStringMapTest.php.

85  {
86  $key = "hello";
87 
88  $this->expectException(NoSuchElementException::class);
89  $this->expectExceptionMessage("No meta data associated with key \"$key\".");
90  $this->subject->get($key);
91  }

◆ testPutValueTwiceWhichShouldFail()

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

Definition at line 54 of file EntryLockingStringMapTest.php.

55  {
56  $key = "hello";
57  $value = "world";
58 
59  $this->subject->put($key, $value);
60 
61  $this->expectException(ElementAlreadyExistsException::class);
62  $this->expectExceptionMessage("Element $key can not be overwritten.");
63 
64  $this->subject->put($key, $value);
65  }

◆ testPutValueWhichShouldSucceed()

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

Definition at line 40 of file EntryLockingStringMapTest.php.

References $result.

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

Field Documentation

◆ $subject

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

Definition at line 27 of file EntryLockingStringMapTest.php.


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