Changeset 35186 for trunk/tests/phpunit/tests/query/postStatus.php
- Timestamp:
- 10/15/2015 04:43:37 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/query/postStatus.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/postStatus.php
r31321 r35186 12 12 public static $author_privatefoo_post; 13 13 14 public static function setUpBeforeClass() { 15 $f = new WP_UnitTest_Factory; 16 17 self::$editor_user = $f->user->create( array( 'role' => 'editor' ) ); 18 self::$author_user = $f->user->create( array( 'role' => 'author' ) ); 19 20 self::$editor_private_post = $f->post->create( array( 'post_author' => self::$editor_user, 'post_status' => 'private' ) ); 21 self::$author_private_post = $f->post->create( array( 'post_author' => self::$author_user, 'post_status' => 'private' ) ); 14 public static function wpSetUpBeforeClass( $factory ) { 15 self::$editor_user = $factory->user->create( array( 'role' => 'editor' ) ); 16 self::$author_user = $factory->user->create( array( 'role' => 'author' ) ); 17 18 self::$editor_private_post = $factory->post->create( array( 'post_author' => self::$editor_user, 'post_status' => 'private' ) ); 19 self::$author_private_post = $factory->post->create( array( 'post_author' => self::$author_user, 'post_status' => 'private' ) ); 22 20 23 21 // Custom status with private=true. 24 22 register_post_status( 'privatefoo', array( 'private' => true ) ); 25 self::$editor_privatefoo_post = $f ->post->create( array( 'post_author' => self::$editor_user, 'post_status' => 'privatefoo' ) );26 self::$author_privatefoo_post = $f ->post->create( array( 'post_author' => self::$author_user, 'post_status' => 'privatefoo' ) );23 self::$editor_privatefoo_post = $factory->post->create( array( 'post_author' => self::$editor_user, 'post_status' => 'privatefoo' ) ); 24 self::$author_privatefoo_post = $factory->post->create( array( 'post_author' => self::$author_user, 'post_status' => 'privatefoo' ) ); 27 25 _unregister_post_status( 'privatefoo' ); 28 29 self::commit_transaction(); 30 } 31 32 public static function tearDownAfterClass() { 26 } 27 28 public static function wpTearDownAfterClass() { 33 29 if ( is_multisite() ) { 34 30 wpmu_delete_user( self::$editor_user ); … … 43 39 wp_delete_post( self::$editor_privatefoo_post, true ); 44 40 wp_delete_post( self::$author_privatefoo_post, true ); 45 46 self::commit_transaction();47 41 } 48 42
Note: See TracChangeset
for help on using the changeset viewer.