| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | public function testDispatch() |
||
| 38 | { |
||
| 39 | $mockEventName = 'a.b-c.d-e'; |
||
| 40 | $mockEvent = Mockery::mock(Event::class); |
||
| 41 | |||
| 42 | $this->mockOriginalDispatcher->shouldReceive('dispatch')->with($mockEventName, $mockEvent); |
||
|
|
|||
| 43 | $this->mockStatsdClient->shouldReceive('increment')->with('a-b-c-d-e'); |
||
| 44 | |||
| 45 | $this->dispatcher->dispatch($mockEventName, $mockEvent); |
||
| 46 | |||
| 47 | |||
| 48 | } |
||
| 49 | |||
| 51 |
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: