WordPress.org

Make WordPress Core

Changeset 723 in tests


Ignore:
Timestamp:
05/24/12 18:25:18 (2 years ago)
Author:
kurtpayne
Message:

Unit tests for ajax "ajax-tag-search" action (wp_ajax_ajax_tag_search function)

Location:
wp-testcase
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_ajax_actions.php

    r722 r723  
    100100            define( 'DOING_AJAX', true ); 
    101101 
     102        // Clear logout cookies 
     103        add_action( 'clear_auth_cookie', array( $this, 'logout' ) ); 
     104 
    102105        // Suppress warnings from "Cannot modify header information - headers already sent by" 
    103106        $this->_error_level = error_reporting(); 
     
    116119        unset( $GLOBALS['comment'] ); 
    117120        remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 ); 
     121        remove_action( 'clear_auth_cookie', array( $this, 'logout' ) ); 
    118122        error_reporting( $this->_error_level ); 
     123    } 
     124 
     125    /** 
     126     * Clear login cookies, unset the current user 
     127     */ 
     128    public function logout() { 
     129        unset( $GLOBALS['current_user'] ); 
     130        $cookies = array(AUTH_COOKIE, SECURE_AUTH_COOKIE, LOGGED_IN_COOKIE, USER_COOKIE, PASS_COOKIE); 
     131        foreach ( $cookies as $c ) 
     132            unset( $_COOKIE[$c] ); 
    119133    } 
    120134 
Note: See TracChangeset for help on using the changeset viewer.