Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function testBeginAndEnd() |
||
34 | { |
||
35 | $this->assertEquals( |
||
36 | 'any', |
||
37 | UtilContainer::getInstance()->getString()->toCamelCase('any') |
||
38 | ); |
||
39 | |||
40 | |||
41 | /** @var MockObject|StringUtil $stringUtil */ |
||
42 | $stringUtil = $this->beginUtilMock('String', ['toCamelCase']); |
||
43 | $stringUtil->expects($this->any()) |
||
|
|||
44 | ->method('toCamelCase') |
||
45 | ->willReturn('fooBar'); |
||
46 | |||
47 | $this->assertEquals( |
||
48 | 'fooBar', |
||
49 | UtilContainer::getInstance()->getString()->toCamelCase('any') |
||
50 | ); |
||
51 | |||
52 | |||
53 | $this->endUtilMock('String'); |
||
54 | $this->assertEquals( |
||
55 | 'any', |
||
56 | UtilContainer::getInstance()->getString()->toCamelCase('any') |
||
57 | ); |
||
58 | } |
||
59 | } |
||
60 |
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: