WordPress.org

Make WordPress Core

Changeset 302 in tests


Ignore:
Timestamp:
05/16/10 20:33:23 (5 years ago)
Author:
westi
Message:

Add a testcase for get_userdata(). See WP#13317.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_pluggable.php

    r228 r302  
    110110     
    111111} 
     112 
     113class TestUserFunction extends _WPEmptyBlog { 
     114 
     115    var $user_ids = array(); 
     116 
     117    function setUp() { 
     118        parent::setUp(); 
     119        // keep track of users we create 
     120        $user_ids = array(); 
     121    } 
     122 
     123    function tearDown() { 
     124        parent::tearDown(); 
     125        // delete any users that were created during tests 
     126        foreach ($this->user_ids as $id) 
     127            wp_delete_user($id); 
     128    } 
     129     
     130    function test_get_userdata() { 
     131        $this->knownWPBug(13317); 
     132        $id = $this->_make_user('administrator'); 
     133         
     134        $this->assertFalse( get_userdata( 0 ) ); 
     135        $this->assertFalse( get_userdata( 'string' ) ); 
     136        $this->assertFalse( get_userdata( array( 'array' ) ) ); 
     137         
     138    } 
     139} 
    112140?> 
Note: See TracChangeset for help on using the changeset viewer.