1 | <?php |
||
12 | class QueryNormalizerTest extends TestCase |
||
13 | { |
||
14 | /** |
||
15 | * @var QueryNormalizer |
||
16 | */ |
||
17 | private $normalizer; |
||
18 | |||
19 | /** |
||
20 | * @return void |
||
21 | */ |
||
22 | public function setUp(): void |
||
31 | |||
32 | /** |
||
33 | * @return void |
||
34 | */ |
||
35 | public function testNormalizeWithStdClass(): void |
||
44 | |||
45 | /** |
||
46 | * @return void |
||
47 | */ |
||
48 | public function testNormalizeWithOptions(): void |
||
60 | |||
61 | /** |
||
62 | * @expectedException \Symfony\Component\Serializer\Exception\CircularReferenceException |
||
63 | * @expectedExceptionMessage A circular reference has been detected when serializing the object of class "stdClass" (configured limit: 1) |
||
64 | * @return void |
||
65 | */ |
||
66 | public function testNormalizeWithCircularReference(): void |
||
79 | |||
80 | /** |
||
81 | * @return void |
||
82 | */ |
||
83 | public function testNormalizeWithJsonSerializable(): void |
||
95 | |||
96 | /** |
||
97 | * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException |
||
98 | * @expectedExceptionMessage The ArrayObject must implement "JsonSerializable" |
||
99 | * @return void |
||
100 | */ |
||
101 | public function testInvalidArgumentExceptionThrownOnInvalidClass(): void |
||
107 | |||
108 | /** |
||
109 | * @expectedException \Symfony\Component\Serializer\Exception\LogicException |
||
110 | * @expectedExceptionMessage Cannot normalize object because injected serializer is not a normalizer |
||
111 | * @return void |
||
112 | */ |
||
113 | public function testLogicExceptionThrownOnInvalidNormalizer(): void |
||
123 | |||
124 | /** |
||
125 | * @return void |
||
126 | */ |
||
127 | public function testSupportsDenormalizationReturnsFalse(): void |
||
131 | |||
132 | /** |
||
133 | * @expectedException \Symfony\Component\Serializer\Exception\LogicException |
||
134 | * @expectedExceptionMessage Cannot denormalize with "TBolier\RethinkQL\Serializer\QueryNormalizer". |
||
135 | * @return void |
||
136 | */ |
||
137 | public function testIfDenormalizeThrowsLogicException(): void |
||
141 | } |
||
142 |
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: