1 | <?php |
||
20 | class ProjectDescriptorBuilderTest extends \Mockery\Adapter\Phpunit\MockeryTestCase |
||
21 | { |
||
22 | /** @var \phpDocumentor\Descriptor\ProjectDescriptorBuilder $fixture */ |
||
23 | protected $fixture; |
||
24 | |||
25 | /** |
||
26 | * Mock of the required AssemblerFactory dependency of the $fixture. |
||
27 | * |
||
28 | * @var \phpDocumentor\Descriptor\Builder\AssemblerFactory|m\MockInterface |
||
29 | */ |
||
30 | protected $assemblerFactory; |
||
31 | |||
32 | /** |
||
33 | * Sets up a minimal fixture with mocked dependencies. |
||
34 | */ |
||
35 | protected function setUp() |
||
42 | |||
43 | /** |
||
44 | * @covers phpDocumentor\Descriptor\ProjectDescriptorBuilder::createProjectDescriptor |
||
45 | * @covers phpDocumentor\Descriptor\ProjectDescriptorBuilder::getProjectDescriptor |
||
46 | */ |
||
47 | public function testCreatesAnEmptyProjectDescriptorWhenCalledFor() |
||
57 | |||
58 | /** |
||
59 | * @covers phpDocumentor\Descriptor\ProjectDescriptorBuilder::setProjectDescriptor |
||
60 | * @covers phpDocumentor\Descriptor\ProjectDescriptorBuilder::getProjectDescriptor |
||
61 | */ |
||
62 | public function testProvidingAPreExistingDescriptorToBuildOn() |
||
71 | |||
72 | /** |
||
73 | * @covers phpDocumentor\Descriptor\ProjectDescriptorBuilder::isVisibilityAllowed |
||
74 | */ |
||
75 | public function testDeterminesWhetherASpecificVisibilityIsAllowedToBeIncluded() |
||
85 | |||
86 | /** |
||
87 | * Creates a new FileReflector mock that can be used as input for the builder. |
||
88 | */ |
||
89 | protected function createFileReflectorMock(): m\MockInterface |
||
93 | |||
94 | protected function createFileDescriptorCreationMock() |
||
110 | |||
111 | /** |
||
112 | * Creates a Mock of an AssemblerFactory. |
||
113 | * |
||
114 | * When a FileReflector (or mock thereof) is passed to the 'get' method this mock will return an |
||
115 | * empty instance of the FileDescriptor class. |
||
116 | * |
||
117 | * @return m\MockInterface|\phpDocumentor\Descriptor\Builder\AssemblerFactory |
||
118 | */ |
||
119 | protected function createAssemblerFactoryMock() |
||
123 | } |
||
124 |
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: