diff --git a/tests/phpunit/tests/post/revisions.php b/tests/phpunit/tests/post/revisions.php index e4e0c500d5..c8effbccc2 100644 --- a/tests/phpunit/tests/post/revisions.php +++ b/tests/phpunit/tests/post/revisions.php @@ -5,6 +5,9 @@ * @group revision */ class Tests_Post_Revisions extends WP_UnitTestCase { + + const POST_TYPE = 'test-revision'; + protected static $admin_user_id; protected static $editor_user_id; protected static $author_user_id; @@ -15,11 +18,6 @@ class Tests_Post_Revisions extends WP_UnitTestCase { self::$author_user_id = $factory->user->create( array( 'role' => 'author' ) ); } - public function set_up() { - parent::set_up(); - $this->post_type = 'test-revision'; - } - /** * Note: Test needs reviewing when #16215 is fixed because I'm not sure the test current tests the "correct" behavior * @@ -318,7 +316,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { */ public function test_revision_view_caps_cpt() { register_post_type( - $this->post_type, + self::POST_TYPE, array( 'capability_type' => 'event', 'map_meta_cap' => true, @@ -328,7 +326,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { $post_id = self::factory()->post->create( array( - 'post_type' => $this->post_type, + 'post_type' => self::POST_TYPE, 'post_author' => self::$editor_user_id, ) ); @@ -360,7 +358,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { */ public function test_revision_restore_caps_cpt() { register_post_type( - $this->post_type, + self::POST_TYPE, array( 'capability_type' => 'event', 'map_meta_cap' => true, @@ -375,7 +373,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { // Create a post as Editor. $post_id = self::factory()->post->create( array( - 'post_type' => $this->post_type, + 'post_type' => self::POST_TYPE, 'post_author' => self::$editor_user_id, ) ); @@ -406,7 +404,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { */ public function test_revision_restore_caps_before_publish() { register_post_type( - $this->post_type, + self::POST_TYPE, array( 'capability_type' => 'post', 'capabilities' => array( @@ -424,7 +422,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { $post_id = self::factory()->post->create( array( - 'post_type' => $this->post_type, + 'post_type' => self::POST_TYPE, 'post_status' => 'draft', ) ); @@ -466,7 +464,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { */ public function test_revision_diff_caps_cpt() { register_post_type( - $this->post_type, + self::POST_TYPE, array( 'capability_type' => 'event', 'map_meta_cap' => true, @@ -476,7 +474,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase { $post_id = self::factory()->post->create( array( - 'post_type' => $this->post_type, + 'post_type' => self::POST_TYPE, 'post_author' => self::$editor_user_id, ) );