| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testRegisterJson() { |
||
| 16 | $view = new View(); |
||
| 17 | $key = 'test'; |
||
| 18 | $data = [ |
||
| 19 | 'name' => 'user one', |
||
| 20 | 'email' => '[email protected]' |
||
| 21 | ]; |
||
| 22 | $view->registerJson($data, $key); |
||
| 23 | |||
| 24 | expect("The supplied array should be encoded as JSON and set on the View obj", $this->assertEquals($data, json_decode($view->json[$view::POS_READY][$key], true))); |
||
|
|
|||
| 25 | |||
| 26 | $view = new View(); |
||
| 27 | $data = [ |
||
| 28 | 'name' => 'user one', |
||
| 29 | 'email' => '[email protected]' |
||
| 30 | ]; |
||
| 31 | $view->registerJson($data); |
||
| 32 | |||
| 33 | $expected_key = md5(json_encode($data, true)); |
||
| 34 | expect("If no key is supplied it should default to the md5 of the json_encoded data", $this->assertArrayHasKey($expected_key, $view->json[$view::POS_READY])); |
||
| 35 | expect("If no key is supplied it should default to the md5 of the json_encoded data", $this->assertEquals(json_encode($data, true), $view->json[$view::POS_READY][$expected_key])); |
||
| 36 | } |
||
| 38 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.