Changeset 53853
- Timestamp:
- 08/07/2022 02:41:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/revisions.php
r53841 r53853 6 6 */ 7 7 class Tests_Post_Revisions extends WP_UnitTestCase { 8 9 const POST_TYPE = 'test-revision'; 10 8 11 protected static $admin_user_id; 9 12 protected static $editor_user_id; … … 14 17 self::$editor_user_id = $factory->user->create( array( 'role' => 'editor' ) ); 15 18 self::$author_user_id = $factory->user->create( array( 'role' => 'author' ) ); 16 }17 18 public function set_up() {19 parent::set_up();20 $this->post_type = 'test-revision';21 19 } 22 20 … … 319 317 public function test_revision_view_caps_cpt() { 320 318 register_post_type( 321 $this->post_type,319 self::POST_TYPE, 322 320 array( 323 321 'capability_type' => 'event', … … 329 327 $post_id = self::factory()->post->create( 330 328 array( 331 'post_type' => $this->post_type,329 'post_type' => self::POST_TYPE, 332 330 'post_author' => self::$editor_user_id, 333 331 ) … … 361 359 public function test_revision_restore_caps_cpt() { 362 360 register_post_type( 363 $this->post_type,361 self::POST_TYPE, 364 362 array( 365 363 'capability_type' => 'event', … … 376 374 $post_id = self::factory()->post->create( 377 375 array( 378 'post_type' => $this->post_type,376 'post_type' => self::POST_TYPE, 379 377 'post_author' => self::$editor_user_id, 380 378 ) … … 407 405 public function test_revision_restore_caps_before_publish() { 408 406 register_post_type( 409 $this->post_type,407 self::POST_TYPE, 410 408 array( 411 409 'capability_type' => 'post', … … 425 423 $post_id = self::factory()->post->create( 426 424 array( 427 'post_type' => $this->post_type,425 'post_type' => self::POST_TYPE, 428 426 'post_status' => 'draft', 429 427 ) … … 467 465 public function test_revision_diff_caps_cpt() { 468 466 register_post_type( 469 $this->post_type,467 self::POST_TYPE, 470 468 array( 471 469 'capability_type' => 'event', … … 477 475 $post_id = self::factory()->post->create( 478 476 array( 479 'post_type' => $this->post_type,477 'post_type' => self::POST_TYPE, 480 478 'post_author' => self::$editor_user_id, 481 479 )
Note: See TracChangeset
for help on using the changeset viewer.