3declare(strict_types=1);
 
   25use PHPUnit\Framework\TestCase;
 
   44    protected function setUp(): void
 
   46        $dataFactory = 
new DataFactory();
 
   47        $language = $this->createMock(ilLanguage::class);
 
   49        $this->f = 
new Refinery($dataFactory, $language);
 
   50        $this->map_values = $this->f->container()->mapValues($this->f->custom()->transformation(fn ($v) => $v * 2));
 
   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));
 
   62        $this->expectException(InvalidArgumentException::class);
 
   63        $this->map_values->transform(
null);
 
Adds to any array keys for each value.
 
Transformation $map_values