function test_ping_update() { $rmt_mck = new mck_mdl_remotes('sue', 'Big fat human'); $rmt = new mdl_remotes(); $_POST['data'] = $rmt->send_ping('http://localhost/', 'update', 'null', $rmt_mck->get_pub_key(), $rmt_mck->get_priv_key(), 'http://localhost/messages/follow/fred', true); $msg = new ctrl_messages(); // call ping ob_start(); $msg->ping(); $result = ob_get_contents(); ob_end_clean(); $xml = $rmt->decode_ping_response($result); $this->assertTrue($xml->state == 'success'); $csh = new mdl_message_cache(); $result = $csh->get_cached_user('http://localhost/messages/follow/fred'); $this->assertEquals($result[0]['Update_cache'], 1); }
function test_clear_cache_update() { $remote_url = 'http://localhost/messages/follow/fred'; $csh = new mdl_message_cache(); $csh->flag_cache_update($remote_url); $csh->clear_cache_update($remote_url); $result = $csh->get_cached_user($remote_url); $this->assertEquals($result[0]['Update_cache'], 0); }