'test', 0 => 1, 2 => true, 'string2' => 1.3, 3 => null, 4 => [ 0 => 'a', 1 => 'b', ], 5 => $serializable, 6 => $jsonSerialize, ]; $expected = [ 'string' => 'test', 0 => 1, 2 => true, 'string2' => 1.3, 3 => null, 4 => [ 0 => 'a', 1 => 'b', ], 5 => $serializable->serialize(), 6 => $jsonSerialize->jsonSerialize(), ]; self::assertEquals($expected, eval('return '. ArrayParser::serializeArray($array) . ';')); } /** * @testdox A value can be encoded and decoded into php code * @covers phpOMS\Utils\Parser\Php\ArrayParser * @group framework */ public function testInvalidValueType() : void { self::expectException(\UnexpectedValueException::class); ArrayParser::parseVariable(new class() {}); } }