ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 @setup More...
 
 testPutValueWhichShouldSucceed ()
 @Test More...
 
 testPutValueTwiceWhichShouldFail ()
 @Test More...
 
 testGetWhichShouldSucceed ()
 @Test More...
 
 testGetWithoutPutTheValueWhichShouldFail ()
 @Test More...
 

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

@runTestsInSeparateProcesses @preserveGlobalState disabled @backupGlobals disabled @backupStaticAttributes disabled

Definition at line 20 of file EntryLockingStringMapTest.php.

Member Function Documentation

◆ setUp()

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

@setup

Definition at line 31 of file EntryLockingStringMapTest.php.

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

◆ testGetWhichShouldSucceed()

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

@Test

Definition at line 68 of file EntryLockingStringMapTest.php.

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

References $key, and $result.

◆ testGetWithoutPutTheValueWhichShouldFail()

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

@Test

Definition at line 82 of file EntryLockingStringMapTest.php.

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

References $key.

◆ testPutValueTwiceWhichShouldFail()

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

@Test

Definition at line 53 of file EntryLockingStringMapTest.php.

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 }

References $key.

◆ testPutValueWhichShouldSucceed()

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

@Test

Definition at line 39 of file EntryLockingStringMapTest.php.

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 }

References $key, and $result.

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: