Definition at line 27 of file MapValuesTest.php.
◆ setUp()
Definition at line 44 of file MapValuesTest.php.
44 : void
45 {
46 $dataFactory = new DataFactory();
47 $language = $this->createMock(ilLanguage::class);
48
49 $this->f = new Refinery($dataFactory, $language);
50 $this->map_values = $this->f->container()->mapValues($this->f->custom()->transformation(fn ($v) => $v * 2));
51 }
◆ testTransform()
| MapValuesTest::testTransform |
( |
| ) |
|
Definition at line 53 of file MapValuesTest.php.
53 : void
54 {
55 $result = $this->map_values->transform($this->test_array);
56 $this->assertEquals($this->result_array, $result);
57 $this->assertEquals(["A", "B", "C"], array_keys($result));
58 }
◆ testTransformFails()
| MapValuesTest::testTransformFails |
( |
| ) |
|
Definition at line 60 of file MapValuesTest.php.
60 : void
61 {
62 $this->expectException(InvalidArgumentException::class);
63 $this->map_values->transform(null);
64 }
◆ $f
| Refinery MapValuesTest::$f |
|
private |
◆ $map_values
◆ $result_array
| array MapValuesTest::$result_array |
|
private |
Initial value:= [
"A" => 520,
"B" => 44,
"C" => 8020
]
Definition at line 36 of file MapValuesTest.php.
◆ $test_array
| array MapValuesTest::$test_array |
|
private |
Initial value:= [
"A" => 260,
"B" => 22,
"C" => 4010
]
Definition at line 30 of file MapValuesTest.php.
The documentation for this class was generated from the following file: