WordPress.org

Make WordPress Core

Changeset 997 in tests


Ignore:
Timestamp:
08/30/12 17:28:42 (20 months ago)
Author:
nacin
Message:

Test for wp_delete_user() not flushing post caches on reassignment. see #WP20447.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user.php

    r967 r997  
    539539        $this->assertFalse( get_userdata( array( 'array' ) ) ); 
    540540    } 
     541 
     542    /** 
     543     * @ticket 20447 
     544     */ 
     545    function test_wp_delete_user_reassignment_clears_post_caches() { 
     546        $user_id   = $this->factory->user->create(); 
     547        $reassign  = $this->factory->user->create(); 
     548        $post_id   = $this->factory->post->create( array( 'post_author' => $user_id ) ); 
     549 
     550        get_post( $post_id ); // Ensure this post is in the cache. 
     551 
     552        wp_delete_user( $user_id, $reassign ); 
     553 
     554        $post = get_post( $post_id ); 
     555        $this->assertEquals( $reassign, $post->post_author ); 
     556    } 
    541557} 
Note: See TracChangeset for help on using the changeset viewer.