ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest Class Reference

Class EntryLockingStringMapTest. More...

+ Inheritance diagram for ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest:
+ Collaboration diagram for ILIAS\GlobalScreen\ScreenContext\AdditionalData\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\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::setUp ( )

Definition at line 31 of file EntryLockingStringMapTest.php.

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

◆ testGetWhichShouldSucceed()

ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::testGetWhichShouldSucceed ( )

Definition at line 69 of file EntryLockingStringMapTest.php.

References ILIAS\LTI\ToolProvider\$key.

70  {
71  $key = "hello";
72  $value = "world";
73 
74  $this->subject->put($key, $value);
75  $result = $this->subject->get($key);
76 
77  $this->assertEquals($value, $result);
78  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ testGetWithoutPutTheValueWhichShouldFail()

ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::testGetWithoutPutTheValueWhichShouldFail ( )

Definition at line 83 of file EntryLockingStringMapTest.php.

References ILIAS\LTI\ToolProvider\$key.

84  {
85  $key = "hello";
86 
87  $this->expectException(NoSuchElementException::class);
88  $this->expectExceptionMessage("No meta data associated with key \"$key\".");
89  $this->subject->get($key);
90  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ testPutValueTwiceWhichShouldFail()

ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::testPutValueTwiceWhichShouldFail ( )

Definition at line 53 of file EntryLockingStringMapTest.php.

References ILIAS\LTI\ToolProvider\$key.

54  {
55  $key = "hello";
56  $value = "world";
57 
58  $this->subject->put($key, $value);
59 
60  $this->expectException(ElementAlreadyExistsException::class);
61  $this->expectExceptionMessage("Element $key can not be overwritten.");
62 
63  $this->subject->put($key, $value);
64  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ testPutValueWhichShouldSucceed()

ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::testPutValueWhichShouldSucceed ( )

Definition at line 39 of file EntryLockingStringMapTest.php.

References ILIAS\LTI\ToolProvider\$key.

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  }
string $key
Consumer key/client ID value.
Definition: System.php:193

Field Documentation

◆ $subject

ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection\EntryLockingStringMapTest::$subject
private

Definition at line 26 of file EntryLockingStringMapTest.php.


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