ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest Class Reference

Class EntryLockingStringMapTest. More...

+ Inheritance diagram for ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest:
+ Collaboration diagram for ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest:

Public Member Functions

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

Private Attributes

EntryLockingStringMap $subject
 

Detailed Description

Member Function Documentation

◆ setUp()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::setUp ( )

Definition at line 51 of file EntryLockingStringMapTest.php.

51  : void
52  {
53  $this->subject = new EntryLockingStringMap();
54  }

◆ testGetWhichShouldSucceed()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::testGetWhichShouldSucceed ( )

Definition at line 83 of file EntryLockingStringMapTest.php.

83  : void
84  {
85  $key = "hello";
86  $value = "world";
87 
88  $this->subject->put($key, $value);
89  $result = $this->subject->get($key);
90 
91  $this->assertEquals($value, $result);
92  }

◆ testGetWithoutPutTheValueWhichShouldFail()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::testGetWithoutPutTheValueWhichShouldFail ( )

Definition at line 95 of file EntryLockingStringMapTest.php.

95  : void
96  {
97  $key = "hello";
98 
99  $this->expectException(NoSuchElementException::class);
100  $this->expectExceptionMessage("No meta data associated with key \"$key\".");
101  $this->subject->get($key);
102  }

◆ testPutValueTwiceWhichShouldFail()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::testPutValueTwiceWhichShouldFail ( )

Definition at line 69 of file EntryLockingStringMapTest.php.

69  : void
70  {
71  $key = "hello";
72  $value = "world";
73 
74  $this->subject->put($key, $value);
75 
76  $this->expectException(ElementAlreadyExistsException::class);
77  $this->expectExceptionMessage("Element $key can not be overwritten.");
78 
79  $this->subject->put($key, $value);
80  }

◆ testPutValueWhichShouldSucceed()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::testPutValueWhichShouldSucceed ( )

Definition at line 57 of file EntryLockingStringMapTest.php.

57  : void
58  {
59  $key = "hello";
60  $value = "world";
61  $this->subject->put($key, $value);
62  $result = $this->subject->toArray();
63 
64  $this->assertArrayHasKey($key, $result);
65  $this->assertEquals($value, $result[$key]);
66  }

Field Documentation

◆ $subject

EntryLockingStringMap ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\EntryLockingStringMapTest::$subject
private

Definition at line 46 of file EntryLockingStringMapTest.php.


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