Changeset 11737 for trunk/tests/phpunit/testcases/blogs/functions.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/blogs/functions.php
r10971 r11737 289 289 290 290 // Create a regular member 291 $u = $this->factory->user->create();291 $u = self::factory()->user->create(); 292 292 293 293 // Create blogs 294 $b1 = $this->factory->blog->create( array( 'user_id' => $u ) );295 $b2 = $this->factory->blog->create( array( 'user_id' => $u ) );294 $b1 = self::factory()->blog->create( array( 'user_id' => $u ) ); 295 $b2 = self::factory()->blog->create( array( 'user_id' => $u ) ); 296 296 297 297 $expected = array( … … 323 323 */ 324 324 public function test_transition_post_status_publish_to_publish() { 325 $post_id = $this->factory->post->create( array(325 $post_id = self::factory()->post->create( array( 326 326 'post_status' => 'publish', 327 327 'post_type' => 'post', … … 344 344 */ 345 345 public function test_transition_post_status_password_publish() { 346 $post_id = $this->factory->post->create( array(346 $post_id = self::factory()->post->create( array( 347 347 'post_status' => 'publish', 348 348 'post_type' => 'post', … … 359 359 */ 360 360 public function test_transition_post_status_publish_update_password() { 361 $post_id = $this->factory->post->create( array(361 $post_id = self::factory()->post->create( array( 362 362 'post_status' => 'publish', 363 363 'post_type' => 'post', … … 380 380 */ 381 381 public function test_transition_post_status_private_publish() { 382 $post_id = $this->factory->post->create( array(382 $post_id = self::factory()->post->create( array( 383 383 'post_status' => 'private', 384 384 'post_type' => 'post', … … 401 401 */ 402 402 public function test_transition_post_status_publish_private() { 403 $post_id = $this->factory->post->create( array(403 $post_id = self::factory()->post->create( array( 404 404 'post_status' => 'publish', 405 405 'post_type' => 'post', … … 422 422 */ 423 423 public function test_transition_post_status_draft_to_draft() { 424 $post_id = $this->factory->post->create( array(424 $post_id = self::factory()->post->create( array( 425 425 'post_status' => 'draft', 426 426 'post_type' => 'post', … … 442 442 */ 443 443 public function test_transition_post_status_draft_to_publish() { 444 $post_id = $this->factory->post->create( array(444 $post_id = self::factory()->post->create( array( 445 445 'post_status' => 'draft', 446 446 'post_type' => 'post', … … 462 462 */ 463 463 public function test_transition_post_status_publish_to_draft() { 464 $post_id = $this->factory->post->create( array(464 $post_id = self::factory()->post->create( array( 465 465 'post_status' => 'publish', 466 466 'post_type' => 'post', … … 482 482 */ 483 483 public function test_transition_post_status_wp_delete_post() { 484 $post_id = $this->factory->post->create( array(484 $post_id = self::factory()->post->create( array( 485 485 'post_status' => 'publish', 486 486 'post_type' => 'post', … … 499 499 */ 500 500 public function test_transition_post_status_wp_trash_post() { 501 $post_id = $this->factory->post->create( array(501 $post_id = self::factory()->post->create( array( 502 502 'post_status' => 'publish', 503 503 'post_type' => 'post', … … 519 519 // save the current user and override logged-in user 520 520 $old_user = get_current_user_id(); 521 $u = $this->factory->user->create();521 $u = self::factory()->user->create(); 522 522 $this->set_current_user( $u ); 523 523 $userdata = get_userdata( $u ); 524 524 525 525 // create the blog post 526 $post_id = $this->factory->post->create( array(526 $post_id = self::factory()->post->create( array( 527 527 'post_status' => 'publish', 528 528 'post_type' => 'post', … … 604 604 // save the current user and override logged-in user 605 605 $old_user = get_current_user_id(); 606 $u = $this->factory->user->create();606 $u = self::factory()->user->create(); 607 607 $this->set_current_user( $u ); 608 608 $userdata = get_userdata( $u ); 609 609 610 610 // create the blog post 611 $post_id = $this->factory->post->create( array(611 $post_id = self::factory()->post->create( array( 612 612 'post_status' => 'publish', 613 613 'post_type' => 'post', … … 666 666 public function test_bp_blogs_post_type_remove_comment() { 667 667 $old_user = get_current_user_id(); 668 $u = $this->factory->user->create();668 $u = self::factory()->user->create(); 669 669 $this->set_current_user( $u ); 670 670 $userdata = get_userdata( $u ); 671 671 672 672 // create the blog post 673 $p = $this->factory->post->create( array(673 $p = self::factory()->post->create( array( 674 674 'post_status' => 'publish', 675 675 'post_type' => 'post', … … 708 708 add_filter( 'bp_blogs_is_blog_trackable', '__return_false' ); 709 709 710 $post_id = $this->factory->post->create( array(710 $post_id = self::factory()->post->create( array( 711 711 'post_status' => 'publish', 712 712 'post_type' => 'post', … … 737 737 add_filter( 'bp_is_blog_public', '__return_zero' ); 738 738 739 $post_id = $this->factory->post->create( array(739 $post_id = self::factory()->post->create( array( 740 740 'post_status' => 'publish', 741 741 'post_type' => 'post', … … 764 764 // save the current user and override logged-in user 765 765 $old_user = get_current_user_id(); 766 $u = $this->factory->user->create();766 $u = self::factory()->user->create(); 767 767 $this->set_current_user( $u ); 768 768 $userdata = get_userdata( $u ); … … 777 777 778 778 // create the blog post 779 $post_id = $this->factory->post->create( array(779 $post_id = self::factory()->post->create( array( 780 780 'post_status' => 'publish', 781 781 'post_type' => 'post', … … 828 828 // Save the current user and override logged-in user 829 829 $old_user = get_current_user_id(); 830 $u = $this->factory->user->create();830 $u = self::factory()->user->create(); 831 831 $this->set_current_user( $u ); 832 832 … … 838 838 839 839 // Create the blog post 840 $post_id = $this->factory->post->create( array(840 $post_id = self::factory()->post->create( array( 841 841 'post_status' => 'publish', 842 842 'post_type' => 'post', … … 887 887 public function test_bp_blogs_comment_sync_activity_comment_for_custom_post_type() { 888 888 if ( is_multisite() ) { 889 $b = $this->factory->blog->create();889 $b = self::factory()->blog->create(); 890 890 switch_to_blog( $b ); 891 891 add_filter( 'comment_flood_filter', '__return_false' ); … … 894 894 } 895 895 896 $u = $this->factory->user->create();896 $u = self::factory()->user->create(); 897 897 $userdata = get_userdata( $u ); 898 898 … … 916 916 add_filter( 'bp_disable_blogforum_comments', '__return_false' ); 917 917 918 $p = $this->factory->post->create( array(918 $p = self::factory()->post->create( array( 919 919 'post_author' => $u, 920 920 'post_type' => 'foo', … … 995 995 $old_user = get_current_user_id(); 996 996 997 $u = $this->factory->user->create();997 $u = self::factory()->user->create(); 998 998 $this->set_current_user( $u ); 999 999 1000 1000 // Create three sites. 1001 $this->factory->blog->create_many( 3, array(1001 self::factory()->blog->create_many( 3, array( 1002 1002 'user_id' => $u 1003 1003 ) ); … … 1031 1031 $_POST['blog_public'] = 1; 1032 1032 1033 $u = $this->factory->user->create();1033 $u = self::factory()->user->create(); 1034 1034 $this->set_current_user( $u ); 1035 1035 1036 1036 // Create three sites. 1037 $b = $this->factory->blog->create( array(1037 $b = self::factory()->blog->create( array( 1038 1038 'user_id' => $u 1039 1039 ) ); … … 1078 1078 $_POST['blog_public'] = 1; 1079 1079 1080 $u = $this->factory->user->create();1080 $u = self::factory()->user->create(); 1081 1081 $this->set_current_user( $u ); 1082 1082 1083 1083 // Create three sites. 1084 $b = $this->factory->blog->create( array(1084 $b = self::factory()->blog->create( array( 1085 1085 'user_id' => $u 1086 1086 ) ); 1087 1087 1088 $u2 = $this->factory->user->create();1088 $u2 = self::factory()->user->create(); 1089 1089 add_user_to_blog( $b, $u2, 'contributor' ); 1090 1090
Note: See TracChangeset
for help on using the changeset viewer.