Changeset 690 in tests for wp-testcase/test_user.php
- Timestamp:
- 04/19/2012 11:08:38 PM (14 years ago)
- File:
-
- 1 edited
-
wp-testcase/test_user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_user.php
r676 r690 410 410 } 411 411 412 function test_global_authordata() { 413 global $authordata, $id; 414 415 $old_post_id = $id; 416 417 $user_id = $this->_make_user('author'); 418 $user = new WP_User( $user_id ); 419 420 $post = array( 421 'post_author' => $user_id, 422 'post_status' => 'publish', 423 'post_content' => rand_str(), 424 'post_title' => rand_str(), 425 'post_type' => 'post' 426 ); 427 428 // insert a post and make sure the ID is ok 429 $post_id = wp_insert_post( $post ); 430 $this->assertTrue( is_numeric( $post_id ) ); 431 432 setup_postdata( get_post( $post_id ) ); 433 434 $this->assertNotEmpty( $authordata ); 435 $this->assertInstanceOf( 'WP_User', $authordata ); 436 $this->assertEquals( $authordata->ID, $user_id ); 437 438 setup_postdata( get_post( $old_post_id ) ); 439 440 wp_delete_post( $post_id, true ); 441 } 412 442 } 413 443
Note: See TracChangeset
for help on using the changeset viewer.