/** * Queries the friends and users table to match the query given. * If no query is provided it returns all friends. * * @return array */ public function execute() { $inv = Api_Dao_FriendInvitation::getInvitation($this->m_inv); error_log('Invitation: ' . $inv); if ($inv != null) { return array('invitation' => array('fuid' => $inv->from_id, 'inv' => $inv->inv_key, 'expires' => $inv->expires)); } else { return array('invitation' => array()); } }
public function testExpireInvitation() { $inv = Api_Dao_FriendInvitation::createInvitation(100001, 3600); $inv_record = Api_Dao_FriendInvitation::getInvitation($inv); $inv_record->expires = time(); $inv_record->save(); Api_Dao_FriendInvitation::deleteAllExpired(); $inv_record = Api_Dao_FriendInvitation::getInvitation($inv); $this->assertFalse($inv_record); }