1 | <?php |
||
18 | class JsonParserTest extends \PHPUnit_Framework_TestCase |
||
19 | { |
||
20 | |||
21 | /*****************/ |
||
22 | /***** TESTS *****/ |
||
23 | /*****************/ |
||
24 | |||
25 | /** |
||
26 | * Test parse returns array if data |
||
27 | * is null. |
||
28 | * |
||
29 | * @access public |
||
30 | * @return void |
||
31 | */ |
||
32 | public function testParseReturnsArrayIfDataIsNull() |
||
40 | |||
41 | /** |
||
42 | * Test parse returns array if data |
||
43 | * is not a string. |
||
44 | * |
||
45 | * @access public |
||
46 | * @return void |
||
47 | */ |
||
48 | public function testParseReturnsArrayIfDataIsNotAString() |
||
56 | |||
57 | /** |
||
58 | * Test parse returns array if data |
||
59 | * is invalid JSON format. |
||
60 | * |
||
61 | * @access public |
||
62 | * @return void |
||
63 | */ |
||
64 | public function testParseReturnsArrayIfDataIsInvalidJsonFormat() |
||
72 | |||
73 | /** |
||
74 | * Test parse returns array if data |
||
75 | * is broken json format. |
||
76 | * |
||
77 | * @access public |
||
78 | * @return void |
||
79 | */ |
||
80 | public function testParseReturnsArrayIfDataIsBrokenJsonFormat() |
||
88 | |||
89 | /** |
||
90 | * Test parse returns array if data |
||
91 | * is valid JSON object. |
||
92 | * |
||
93 | * @access public |
||
94 | * @return void |
||
95 | */ |
||
96 | public function testParseReturnsArrayIfDataIsValidJsonObject() |
||
104 | |||
105 | /** |
||
106 | * Test parse returns array if data |
||
107 | * is valid JSON array. |
||
108 | * |
||
109 | * @access public |
||
110 | * @return void |
||
111 | */ |
||
112 | public function testParseReturnsArrayIfDataIsValidJsonArray() |
||
120 | |||
121 | /** |
||
122 | * Test parse successfully parses data |
||
123 | * if data is valid JSON object. |
||
124 | * |
||
125 | * @access public |
||
126 | * @return void |
||
127 | */ |
||
128 | public function testParseSuccessfullyParsesDataIfDataIsValidJsonObject() |
||
141 | |||
142 | /** |
||
143 | * Test parse successfully parses data |
||
144 | * if data is valid JSON array. |
||
145 | * |
||
146 | * @access public |
||
147 | * @return void |
||
148 | */ |
||
149 | public function testParseSuccessfullyParsesDataIfDataIsValidJsonArray() |
||
162 | |||
163 | /** |
||
164 | * Test parse successfully parses |
||
165 | * multidimensional data if data is |
||
166 | * valid JSON format. |
||
167 | * |
||
168 | * @access public |
||
169 | * @return void |
||
170 | */ |
||
171 | public function testParseSuccessfullyParsesMultidimensionalDataIfDataIsValidJsonFormat() |
||
192 | |||
193 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
194 | /** ++++++++++ TEST ENTITIES ++++++++++ **/ |
||
195 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
196 | |||
197 | /** |
||
198 | * Get JSON parser instance. |
||
199 | * |
||
200 | * @access protected |
||
201 | * @return \JonnyW\PhantomJs\Parser\JsonParser |
||
202 | */ |
||
203 | protected function getJsonParser() |
||
209 | } |
||
210 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: