ILIAS  release_8 Revision v8.24
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 21 of file EntryLockingStringMapTest.php.

Member Function Documentation

◆ setUp()

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

@setup

Definition at line 31 of file EntryLockingStringMapTest.php.

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

◆ testGetWhichShouldSucceed()

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

@Test

Definition at line 69 of file EntryLockingStringMapTest.php.

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

References ILIAS\LTI\ToolProvider\$key.

◆ testGetWithoutPutTheValueWhichShouldFail()

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

@Test

Definition at line 83 of file EntryLockingStringMapTest.php.

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 }

References ILIAS\LTI\ToolProvider\$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->expectException(ElementAlreadyExistsException::class);
61 $this->expectExceptionMessage("Element $key can not be overwritten.");
62
63 $this->subject->put($key, $value);
64 }

References ILIAS\LTI\ToolProvider\$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 ILIAS\LTI\ToolProvider\$key.

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: