WordPress.org

Make WordPress Core

Changeset 608 in tests


Ignore:
Timestamp:
04/05/12 19:28:54 (3 years ago)
Author:
markjaquith
Message:

Make a new author instead of depending on the built-in one. Better user existence assertion (WP_User always returns an object of WP_User, so it is a completely useless test).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_user_capabilities.php

    r589 r608  
    452452        // simple tests for some common meta capabilities 
    453453 
     454        // Make our author 
     455        $author = new WP_User($this->_make_user('author'));      
     456 
    454457        // make a [pst 
    455         $this->_insert_quick_posts(1); 
     458        $this->_insert_quick_posts(1, 'post', array( 'post_author' => $author->ID ) ); 
    456459        $post = end($this->post_ids); 
    457460 
    458461        // the author of the post 
    459         $author = new WP_User($this->author->ID); 
    460         $this->assertInstanceOf('WP_User', $author, "Problem getting user " . $this->author->ID); 
    461         $author->set_role('author'); 
     462        $this->assertThat($author->data, $this->isType('object')); 
    462463 
    463464        // add some other users 
Note: See TracChangeset for help on using the changeset viewer.