function get_available_serialiser($log) { $log->log_message('Getting serialiser', get_class($this), CS_REST_LOG_VERBOSE); if (@CS_REST_NativeJsonSerialiser::is_available()) { return new CS_REST_NativeJsonSerialiser($log); } else { return new CS_REST_ServicesJsonSerialiser($log); } }
for ($i = 0; $i < count($expected); $i++) { $this->assert_identical_ignoring_type($object[$i], $expected[$i], $message . ' Checking #' . $i); } } else { foreach ($expected as $k => $v) { $this->assert_identical_ignoring_type($object->{$k}, $v, $message . ' Checking ' . $k); } } } else { $this->assertEqual($expected, $object, $message . ' Items are not equal'); } } } class CS_REST_TestServices_JSONResponseDeserialisation extends CS_REST_TestResponseDeserialisation { function CS_REST_TestServices_JSONResponseDeserialisation() { $log =& new MockCS_REST_Log($this); $this->CS_REST_TestResponseDeserialisation(new CS_REST_ServicesJsonSerialiser($log)); } } if (@CS_REST_NativeJsonSerialiser::is_available()) { class CS_REST_TestJSONResponseDeserialisation extends CS_REST_TestResponseDeserialisation { function CS_REST_TestJSONResponseDeserialisation() { $log =& new MockCS_REST_Log($this); $this->CS_REST_TestResponseDeserialisation(new CS_REST_NativeJsonSerialiser($log)); } } }