ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Component\Tests\Dependencies\RenamingDICTest Class Reference
+ Inheritance diagram for ILIAS\Component\Tests\Dependencies\RenamingDICTest:
+ Collaboration diagram for ILIAS\Component\Tests\Dependencies\RenamingDICTest:

Public Member Functions

 testRenaming ()
 

Detailed Description

Definition at line 26 of file RenamingDICTest.php.

Member Function Documentation

◆ testRenaming()

ILIAS\Component\Tests\Dependencies\RenamingDICTest::testRenaming ( )

Definition at line 28 of file RenamingDICTest.php.

29 {
30 $wrapped = new class () implements \ArrayAccess {
31 public array $data = [];
32
33 public function offsetSet($id, $value): void
34 {
35 $this->data[] = [$id, $value];
36 }
37
38 public function offsetGet($id): null
39 {
40 }
41 public function offsetExists($id): false
42 {
43 }
44 public function offsetUnset($id): void
45 {
46 }
47 };
48 $wrapper = new RenamingDIC($wrapped);
49
50 $wrapper["Foo"] = "Bar";
51 $wrapper["Baz"] = "Bla";
52 $wrapper["Foo"] = "Foobar";
53
54 $expected = [["Foo_0", "Bar"], ["Baz_1", "Bla"], ["Foo_2", "Foobar"]];
55 $this->assertEquals($expected, $wrapped->data);
56 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $data, and $id.


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