Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function test_store_file_no_config() |
||
29 | { |
||
30 | /** @var Mock|CacheManager $manager */ |
||
31 | $manager = \Mockery::mock(CacheManager::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||
32 | $manager->shouldReceive('getConfig')->andReturnUsing(function ($name, $default) { |
||
33 | return $default; |
||
34 | }); |
||
35 | |||
36 | $store = $manager->store(); |
||
37 | self::assertInstanceOf(Repository::class, $store); |
||
38 | } |
||
39 | } |
||
40 |
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: