assertEquals($expectedJSONRPCType, $type->getJSONRPCType()); } /** * @dataProvider provideBaseTypes * @param $typehint * @param $expectedJSONRPCType * @param $expectedXMLRPCType * @param $context * @return void */ public function testXMLBaseTypes($typehint, $expectedJSONRPCType, $expectedXMLRPCType, $context = '') { $type = new Type($typehint, $context); $this->assertEquals($expectedXMLRPCType, $type->getXMLRPCType()); } public function provideSubTypes() { return [ ['string', ['string']], ['string[]', ['array', 'string']], ['string[][]', ['array', 'array', 'string']], ['array[][]', ['array', 'array', 'array']], ['Foo[][]', ['array', 'array', 'Foo']], ['Foo[][]', ['array', 'array', 'dokuwiki\\test\\Remote\\OpenApiDoc\\Foo'], self::class], ]; } /** * @dataProvider provideSubTypes * @param $typehint * @param $expected * @param $context * @return void */ public function testSubType($typehint, $expected, $context = '') { $type = new Type($typehint, $context); $result = [$type->getJSONRPCType()]; while ($type = $type->getSubType()) { $result[] = $type->getJSONRPCType(); } $this->assertEquals($expected, $result); } }