1 | <?php |
||
25 | class ResolveInlineLinkAndSeeTagsTest extends \Mockery\Adapter\Phpunit\MockeryTestCase |
||
26 | { |
||
27 | /** @var Queue|m\MockInterface */ |
||
28 | private $router; |
||
29 | |||
30 | /** @var ResolveInlineLinkAndSeeTags */ |
||
31 | private $fixture; |
||
32 | |||
33 | /** |
||
34 | * Initializes the fixture and its dependencies. |
||
35 | */ |
||
36 | protected function setUp() |
||
41 | |||
42 | /** |
||
43 | * @covers ::getDescription |
||
44 | */ |
||
45 | public function testDescriptionName() |
||
49 | |||
50 | /** |
||
51 | * @covers ::execute |
||
52 | */ |
||
53 | public function testReplaceDescriptionIfItContainsNoSeeOrLink() |
||
65 | |||
66 | /** |
||
67 | * @covers ::execute |
||
68 | */ |
||
69 | public function testReplaceDescriptionIfItContainsASeeButFileIsNotAvailable() |
||
86 | |||
87 | /** |
||
88 | * @covers ::execute |
||
89 | */ |
||
90 | public function testReplaceDescriptionIfItContainsASeeAndFileIsPresent() |
||
107 | |||
108 | /** |
||
109 | * @covers ::execute |
||
110 | */ |
||
111 | public function testReplaceDescriptionIfItContainsAnotherTag() |
||
125 | |||
126 | /** |
||
127 | * Returns a mocked Descriptor with its description set to the given value. |
||
128 | * |
||
129 | * @param string $description |
||
130 | * |
||
131 | * @return m\MockInterface |
||
132 | */ |
||
133 | private function givenAChildDescriptorWithDescription($description) |
||
140 | |||
141 | /** |
||
142 | * Returns a mocked Project Descriptor. |
||
143 | * |
||
144 | * @param Collection|m\MockInterface $descriptors |
||
145 | * |
||
146 | * @return m\MockInterface |
||
147 | */ |
||
148 | private function givenAProjectDescriptorWithChildDescriptors($descriptors) |
||
155 | |||
156 | /** |
||
157 | * Returns the descriptor of the element that the link points to |
||
158 | * |
||
159 | * @return DescriptorAbstract|m\MockInterface |
||
160 | */ |
||
161 | private function givenAnElementToLinkTo() |
||
172 | |||
173 | /** |
||
174 | * Returns a collection with descriptor. This collection will be scanned to see if a link can be made to a file. |
||
175 | * |
||
176 | * @param DescriptorAbstract|m\MockInterface $descriptor |
||
177 | * |
||
178 | * @return Collection|m\MockInterface |
||
179 | */ |
||
180 | private function givenACollection($descriptor) |
||
190 | |||
191 | /** |
||
192 | * Verifies if the given descriptor's setDescription method is called with the given value. |
||
193 | * |
||
194 | * @param m\MockInterface $descriptor |
||
195 | * @param string $expected |
||
196 | */ |
||
197 | public function thenDescriptionOfDescriptorIsChangedInto($descriptor, $expected) |
||
201 | |||
202 | /** |
||
203 | * It resolves the element that is linked to |
||
204 | * |
||
205 | * @param m\MockInterface $descriptor |
||
206 | * @param DescriptorAbstract $elementToLinkTo |
||
207 | * |
||
208 | * @return DescriptorAbstract |
||
209 | */ |
||
210 | private function whenDescriptionContainsSeeOrLinkWithElement($descriptor, $elementToLinkTo) |
||
220 | } |
||
221 |
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: