Changeset 695 in tests
- Timestamp:
- 04/24/2012 03:01:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_includes_author.php
r692 r695 17 17 $this->_deprecated_errors = array(); 18 18 19 global $id; 20 21 $this->old_post_id = $id; 22 23 $this->author_id = $this->_make_user( 'author', 'test_author' ); 19 $this->author_id = $this->_make_user( 'author', 'test_author' ); 24 20 $user = new WP_User( $this->author_id ); 25 21 … … 40 36 function tearDown() { 41 37 parent::tearDown(); 38 42 39 // delete any users that were created during tests 43 40 $this->_destroy_users(); 44 41 45 setup_postdata( get_post( $this->old_post_id ));42 wp_reset_postdata(); 46 43 } 47 44 … … 63 60 64 61 function test_get_the_author_meta() { 65 $user = new WP_User( $this->author_id );66 67 62 $this->assertEquals( 'test_author', get_the_author_meta( 'login' ) ); 68 63 $this->assertEquals( 'test_author', get_the_author_meta( 'user_login' ) ); … … 83 78 84 79 $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) ); 85 80 } 81 82 function test_get_the_author_meta_no_authordata() { 83 unset( $GLOBALS['authordata'] ); 84 $this->assertEquals( '', get_the_author_meta( 'id' ) ); 85 $this->assertEquals( '', get_the_author_meta( 'user_login' ) ); 86 $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) ); 86 87 } 87 88 }
Note: See TracChangeset
for help on using the changeset viewer.