1 | <?php |
||
26 | class FunctionAssemblerTest extends \Mockery\Adapter\Phpunit\MockeryTestCase |
||
27 | { |
||
28 | /** @var FunctionAssembler $fixture */ |
||
29 | protected $fixture; |
||
30 | |||
31 | /** @var ArgumentAssembler|m\MockInterface */ |
||
32 | protected $argumentAssemblerMock; |
||
33 | |||
34 | /** @var ProjectDescriptorBuilder|m\MockInterface */ |
||
35 | protected $builderMock; |
||
36 | |||
37 | /** |
||
38 | * Creates a new fixture to test with. |
||
39 | */ |
||
40 | protected function setUp() |
||
59 | |||
60 | /** |
||
61 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::__construct |
||
62 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::create |
||
63 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::mapReflectorPropertiesOntoDescriptor |
||
64 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::addArgumentsToFunctionDescriptor |
||
65 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::createArgumentDescriptor |
||
66 | * @covers \phpDocumentor\Descriptor\Builder\Reflector\FunctionAssembler::addArgumentDescriptorToFunction |
||
67 | */ |
||
68 | public function testCreateFunctionDescriptorFromReflector() |
||
99 | |||
100 | /** |
||
101 | * Creates a sample function reflector for the tests with the given data. |
||
102 | * |
||
103 | * @param string $namespace |
||
104 | * @param string $functionName |
||
105 | * @param Argument $argumentMock |
||
106 | * @param DocBlock|m\MockInterface $docBlockMock |
||
107 | * |
||
108 | * @return Function_ |
||
109 | */ |
||
110 | protected function givenAFunctionReflector($namespace, $functionName, $argumentMock, $docBlockMock) |
||
121 | |||
122 | /** |
||
123 | * Generates a DocBlock object with applicable defaults for these tests. |
||
124 | * |
||
125 | * @return DocBlock |
||
126 | */ |
||
127 | protected function givenADocBlockObject() |
||
138 | |||
139 | /** |
||
140 | * Prepares a mock Argument with the given name. |
||
141 | * |
||
142 | * @param string $argumentName |
||
143 | * |
||
144 | * @return Argument |
||
145 | */ |
||
146 | protected function givenAnArgumentWithName($argumentName) |
||
150 | } |
||
151 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: