24 $this->_typeProcessor = $this->createPartialMock(
25 \
Magento\Framework\Reflection\TypeProcessor::class,
28 $this->_typeProcessor->expects(
33 $this->returnValueMap([[
'string',
'str'], [
'int',
'int']])
35 $this->_classReflector = new \Magento\Webapi\Model\Config\ClassReflector($this->_typeProcessor);
40 $data = $this->_classReflector->reflectClassMethods(
42 [
'generateRandomString' => [
'method' =>
'generateRandomString']]
47 public function testExtractMethodData()
49 $classReflection = new \Zend\Code\Reflection\ClassReflection(
53 $methodReflection = $classReflection->getMethods()[0];
54 $methodData = $this->_classReflector->extractMethodData($methodReflection);
56 $this->assertEquals($expectedResponse, $methodData);
67 'documentation' =>
'Basic random string generator. This line is short description ' .
68 'This line is long description. This is still the long description.',
75 'documentation' =>
'length of the random string',
81 'result' => [
'type' =>
'string',
'documentation' =>
'random string',
'required' =>
true],
testReflectClassMethods()
_getSampleReflectionData()