1 | <?php |
||
13 | class SuperClosureTest extends \PHPUnit_Framework_TestCase |
||
14 | { |
||
15 | /** |
||
16 | * @var SerializerInterface |
||
17 | */ |
||
18 | public $serializer; |
||
19 | |||
20 | /** |
||
21 | * @var \PHPUnit_Framework_MockObject_MockObject|\SuperClosure\Serializer |
||
22 | */ |
||
23 | public $superClosure; |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | */ |
||
28 | public function setUp() |
||
33 | |||
34 | /** |
||
35 | * |
||
36 | */ |
||
37 | public function testSerializeCalled() |
||
51 | |||
52 | /** |
||
53 | * |
||
54 | */ |
||
55 | public function testSerializeNonClosure() |
||
61 | |||
62 | /** |
||
63 | * |
||
64 | */ |
||
65 | public function testUnserializeCalled() |
||
73 | } |
||
74 |
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: