Changeset 11737 for trunk/tests/phpunit/testcases/activity/template.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/template.php
r11091 r11737 10 10 public function test_user_can_delete() { 11 11 $bp = buddypress(); 12 $u = $this->factory->user->create();12 $u = self::factory()->user->create(); 13 13 $original_user = bp_loggedin_user_id(); 14 14 $this->set_current_user( $u ); 15 15 16 $a = $this->factory->activity->create( array(16 $a = self::factory()->activity->create( array( 17 17 'type' => 'activity_update', 18 18 'user_id' => $u, … … 20 20 21 21 // User can delete his own items 22 $activity = $this->factory->activity->get_object_by_id( $a );22 $activity = self::factory()->activity->get_object_by_id( $a ); 23 23 $this->assertTrue( bp_activity_user_can_delete( $activity ) ); 24 24 … … 28 28 29 29 // Miscellaneous user can't delete 30 $misc_user = $this->factory->user->create( array( 'role' => 'subscriber' ) );30 $misc_user = self::factory()->user->create( array( 'role' => 'subscriber' ) ); 31 31 $this->set_current_user( $misc_user ); 32 32 $this->assertFalse( bp_activity_user_can_delete( $activity ) ); … … 52 52 // save the current user and override logged-in user 53 53 $old_user = get_current_user_id(); 54 $u = $this->factory->user->create();54 $u = self::factory()->user->create(); 55 55 $this->set_current_user( $u ); 56 56 57 57 // create an activity update for the user 58 $this->factory->activity->create( array(58 self::factory()->activity->create( array( 59 59 'component' => buddypress()->activity->id, 60 60 'type' => 'activity_update', … … 81 81 */ 82 82 public function test_bp_has_activities_favorites_action_filter() { 83 $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );84 85 $now = time(); 86 87 $a1 = $this->factory->activity->create( array(83 $user_id = self::factory()->user->create( array( 'role' => 'subscriber' ) ); 84 85 $now = time(); 86 87 $a1 = self::factory()->activity->create( array( 88 88 'type' => 'activity_update', 89 89 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 90 90 ) ); 91 91 92 $a2 = $this->factory->activity->create( array(92 $a2 = self::factory()->activity->create( array( 93 93 'type' => 'joined_group', 94 94 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 141 141 */ 142 142 function test_bp_has_activities_just_me_scope_with_no_user_id() { 143 $u1 = $this->factory->user->create();144 $u2 = $this->factory->user->create();143 $u1 = self::factory()->user->create(); 144 $u2 = self::factory()->user->create(); 145 145 146 146 // save the current user and override logged-in user … … 151 151 152 152 // activity item 153 $a1 = $this->factory->activity->create( array(153 $a1 = self::factory()->activity->create( array( 154 154 'user_id' => $u1, 155 155 'component' => 'activity', … … 160 160 // misc activity items 161 161 162 $this->factory->activity->create( array(162 self::factory()->activity->create( array( 163 163 'user_id' => $u2, 164 164 'component' => 'activity', … … 166 166 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 167 167 ) ); 168 $this->factory->activity->create( array(168 self::factory()->activity->create( array( 169 169 'user_id' => $u2, 170 170 'component' => 'groups', … … 197 197 */ 198 198 function test_bp_has_activities_mentions_scope() { 199 $u1 = $this->factory->user->create();200 $u2 = $this->factory->user->create();199 $u1 = self::factory()->user->create(); 200 $u2 = self::factory()->user->create(); 201 201 202 202 $now = time(); … … 204 204 // mentioned activity item 205 205 $mention_username = '@' . bp_activity_get_user_mentionname( $u1 ); 206 $a1 = $this->factory->activity->create( array(206 $a1 = self::factory()->activity->create( array( 207 207 'user_id' => $u2, 208 208 'type' => 'activity_update', … … 212 212 213 213 // misc activity items 214 $this->factory->activity->create( array(214 self::factory()->activity->create( array( 215 215 'user_id' => $u1, 216 216 'component' => 'blogs', … … 219 219 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 220 220 ) ); 221 $this->factory->activity->create( array(221 self::factory()->activity->create( array( 222 222 'user_id' => $u2, 223 223 'component' => 'activity', … … 225 225 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 226 226 ) ); 227 $this->factory->activity->create( array(227 self::factory()->activity->create( array( 228 228 'user_id' => $u2, 229 229 'component' => 'groups', … … 254 254 */ 255 255 function test_bp_has_activities_friends_and_mentions_scope() { 256 $u1 = $this->factory->user->create();257 $u2 = $this->factory->user->create();258 $u3 = $this->factory->user->create();256 $u1 = self::factory()->user->create(); 257 $u2 = self::factory()->user->create(); 258 $u3 = self::factory()->user->create(); 259 259 260 260 // user 1 becomes friends with user 2 … … 264 264 265 265 // friend status update 266 $a1 = $this->factory->activity->create( array(266 $a1 = self::factory()->activity->create( array( 267 267 'user_id' => $u2, 268 268 'type' => 'activity_update', … … 272 272 // mentioned item by non-friend 273 273 $mention_username = '@' . bp_activity_get_user_mentionname( $u1 ); 274 $a2 = $this->factory->activity->create( array(274 $a2 = self::factory()->activity->create( array( 275 275 'user_id' => $u3, 276 276 'component' => 'activity', … … 281 281 282 282 // misc activity items 283 $this->factory->activity->create( array(283 self::factory()->activity->create( array( 284 284 'user_id' => $u1, 285 285 'component' => 'blogs', … … 288 288 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 289 289 ) ); 290 $this->factory->activity->create( array(290 self::factory()->activity->create( array( 291 291 'user_id' => $u3, 292 292 'component' => 'activity', … … 294 294 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 295 295 ) ); 296 $this->factory->activity->create( array(296 self::factory()->activity->create( array( 297 297 'user_id' => $u3, 298 298 'component' => 'groups', … … 323 323 */ 324 324 function test_bp_has_activities_groups_and_friends_scope() { 325 $u1 = $this->factory->user->create();326 $u2 = $this->factory->user->create();327 $u3 = $this->factory->user->create();325 $u1 = self::factory()->user->create(); 326 $u2 = self::factory()->user->create(); 327 $u3 = self::factory()->user->create(); 328 328 329 329 // user 1 becomes friends with user 2 … … 331 331 332 332 // user 1 joins a group 333 $g1 = $this->factory->group->create( array( 'creator_id' => $u1 ) );334 $g2 = $this->factory->group->create( array( 'creator_id' => $u1 ) );333 $g1 = self::factory()->group->create( array( 'creator_id' => $u1 ) ); 334 $g2 = self::factory()->group->create( array( 'creator_id' => $u1 ) ); 335 335 336 336 $now = time(); 337 337 338 338 // friend status update 339 $a1 = $this->factory->activity->create( array(339 $a1 = self::factory()->activity->create( array( 340 340 'user_id' => $u2, 341 341 'type' => 'activity_update', … … 344 344 345 345 // group activity 346 $a2 = $this->factory->activity->create( array(346 $a2 = self::factory()->activity->create( array( 347 347 'user_id' => $u3, 348 348 'component' => 'groups', … … 353 353 354 354 // misc activity items 355 $this->factory->activity->create( array(355 self::factory()->activity->create( array( 356 356 'user_id' => $u3, 357 357 'component' => 'blogs', … … 360 360 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 361 361 ) ); 362 $this->factory->activity->create( array(362 self::factory()->activity->create( array( 363 363 'user_id' => $u3, 364 364 'component' => 'activity', … … 370 370 global $wpdb, $bp; 371 371 $max_group_id = $wpdb->get_var( "SELECT id FROM {$bp->groups->table_name} ORDER BY id DESC LIMIT 1" ); 372 $this->factory->activity->create( array(372 self::factory()->activity->create( array( 373 373 'user_id' => $u3, 374 374 'component' => 'groups', … … 399 399 */ 400 400 function test_bp_has_activities_scope_friends_no_items() { 401 $u1 = $this->factory->user->create();401 $u1 = self::factory()->user->create(); 402 402 403 403 $now = time(); 404 404 405 405 // Create a random activity 406 $this->factory->activity->create( array(406 self::factory()->activity->create( array( 407 407 'user_id' => $u1, 408 408 'type' => 'activity_update', … … 432 432 */ 433 433 function test_bp_has_activities_scope_favorites_no_items() { 434 $u1 = $this->factory->user->create();434 $u1 = self::factory()->user->create(); 435 435 436 436 $now = time(); 437 437 438 438 // Create a random activity 439 $this->factory->activity->create( array(439 self::factory()->activity->create( array( 440 440 'user_id' => $u1, 441 441 'type' => 'activity_update', … … 465 465 */ 466 466 function test_bp_has_activities_scope_groups_no_items() { 467 $u1 = $this->factory->user->create();467 $u1 = self::factory()->user->create(); 468 468 469 469 $now = time(); 470 470 471 471 // Create a random activity 472 $this->factory->activity->create( array(472 self::factory()->activity->create( array( 473 473 'user_id' => $u1, 474 474 'type' => 'activity_update', … … 498 498 */ 499 499 function test_bp_has_activities_scope_mentions_no_items() { 500 $u1 = $this->factory->user->create();500 $u1 = self::factory()->user->create(); 501 501 502 502 $now = time(); 503 503 504 504 // Create a random activity 505 $this->factory->activity->create( array(505 self::factory()->activity->create( array( 506 506 'user_id' => $u1, 507 507 'type' => 'activity_update', … … 530 530 */ 531 531 public function test_bp_has_activities_scope_friends_should_respect_id_order_when_record_dates_are_same() { 532 $u1 = $this->factory->user->create();533 $u2 = $this->factory->user->create();532 $u1 = self::factory()->user->create(); 533 $u2 = self::factory()->user->create(); 534 534 535 535 friends_add_friend( $u1, $u2, true ); 536 536 537 537 // Friend's very fast status updates. 538 $a1 = $this->factory->activity->create( array(538 $a1 = self::factory()->activity->create( array( 539 539 'user_id' => $u2, 540 540 'type' => 'activity_update', 541 541 'recorded_time' => date( 'Y-m-d H:i:s', 1451944920 ), 542 542 ) ); 543 $a2 = $this->factory->activity->create( array(543 $a2 = self::factory()->activity->create( array( 544 544 'user_id' => $u2, 545 545 'type' => 'activity_update', … … 569 569 */ 570 570 public function test_bp_has_activities_scope_groups_should_respect_id_order_when_record_dates_are_same() { 571 $u1 = $this->factory->user->create();572 $u2 = $this->factory->user->create();573 $u3 = $this->factory->user->create();574 575 $g1 = $this->factory->group->create( array( 'creator_id' => $u1 ) );571 $u1 = self::factory()->user->create(); 572 $u2 = self::factory()->user->create(); 573 $u3 = self::factory()->user->create(); 574 575 $g1 = self::factory()->group->create( array( 'creator_id' => $u1 ) ); 576 576 577 577 // Two user join first user's group same time 578 $a1 = $this->factory->activity->create( array(578 $a1 = self::factory()->activity->create( array( 579 579 'user_id' => $u2, 580 580 'component' => 'groups', … … 583 583 'recorded_time' => date( 'Y-m-d H:i:s', 1451944920 ), 584 584 ) ); 585 $a2 = $this->factory->activity->create( array(585 $a2 = self::factory()->activity->create( array( 586 586 'user_id' => $u3, 587 587 'component' => 'groups', … … 613 613 */ 614 614 function test_bp_has_activities_with_filter_query_nested_conditions() { 615 $u1 = $this->factory->user->create();616 $u2 = $this->factory->user->create();617 $u3 = $this->factory->user->create();618 619 $now = time(); 620 621 $a1 = $this->factory->activity->create( array(615 $u1 = self::factory()->user->create(); 616 $u2 = self::factory()->user->create(); 617 $u3 = self::factory()->user->create(); 618 619 $now = time(); 620 621 $a1 = self::factory()->activity->create( array( 622 622 'user_id' => $u3, 623 623 'component' => 'blogs', … … 626 626 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 627 627 ) ); 628 $a2 = $this->factory->activity->create( array(628 $a2 = self::factory()->activity->create( array( 629 629 'user_id' => $u2, 630 630 'component' => 'activity', … … 634 634 635 635 // misc activity items 636 $this->factory->activity->create( array(636 self::factory()->activity->create( array( 637 637 'user_id' => $u3, 638 638 'component' => 'activity', … … 640 640 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 641 641 ) ); 642 $this->factory->activity->create( array(642 self::factory()->activity->create( array( 643 643 'user_id' => $u3, 644 644 'component' => 'groups', … … 683 683 */ 684 684 function test_bp_has_activities_with_filter_query_compare_not_in_operator() { 685 $u1 = $this->factory->user->create();686 $u2 = $this->factory->user->create();687 $u3 = $this->factory->user->create();685 $u1 = self::factory()->user->create(); 686 $u2 = self::factory()->user->create(); 687 $u3 = self::factory()->user->create(); 688 688 689 689 $now = time(); 690 690 691 691 // misc activity items 692 $a1 = $this->factory->activity->create( array(692 $a1 = self::factory()->activity->create( array( 693 693 'user_id' => $u3, 694 694 'component' => 'blogs', … … 697 697 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 698 698 ) ); 699 $a2 = $this->factory->activity->create( array(699 $a2 = self::factory()->activity->create( array( 700 700 'user_id' => $u2, 701 701 'component' => 'activity', … … 703 703 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 704 704 ) ); 705 $a3 = $this->factory->activity->create( array(705 $a3 = self::factory()->activity->create( array( 706 706 'user_id' => $u3, 707 707 'component' => 'activity', … … 709 709 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 710 710 ) ); 711 $a4 = $this->factory->activity->create( array(711 $a4 = self::factory()->activity->create( array( 712 712 'user_id' => $u3, 713 713 'component' => 'groups', … … 741 741 */ 742 742 function test_bp_has_activities_with_filter_query_compare_between_operator() { 743 $u1 = $this->factory->user->create();743 $u1 = self::factory()->user->create(); 744 744 745 745 $now = time(); 746 746 747 747 // misc activity items 748 $a1 = $this->factory->activity->create( array(748 $a1 = self::factory()->activity->create( array( 749 749 'user_id' => $u1, 750 750 'component' => 'blogs', … … 753 753 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 754 754 ) ); 755 $a2 = $this->factory->activity->create( array(755 $a2 = self::factory()->activity->create( array( 756 756 'user_id' => $u1, 757 757 'component' => 'activity', … … 759 759 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 760 760 ) ); 761 $a3 = $this->factory->activity->create( array(761 $a3 = self::factory()->activity->create( array( 762 762 'user_id' => $u1, 763 763 'component' => 'activity', … … 765 765 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 766 766 ) ); 767 $a4 = $this->factory->activity->create( array(767 $a4 = self::factory()->activity->create( array( 768 768 'user_id' => $u1, 769 769 'component' => 'groups', … … 797 797 */ 798 798 function test_bp_has_activities_with_filter_query_compare_arithmetic_comparisons() { 799 $u1 = $this->factory->user->create();799 $u1 = self::factory()->user->create(); 800 800 801 801 $now = time(); 802 802 803 803 // misc activity items 804 $a1 = $this->factory->activity->create( array(804 $a1 = self::factory()->activity->create( array( 805 805 'user_id' => $u1, 806 806 'component' => 'activity', … … 809 809 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 810 810 ) ); 811 $a2 = $this->factory->activity->create( array(811 $a2 = self::factory()->activity->create( array( 812 812 'user_id' => $u1, 813 813 'component' => 'activity', … … 816 816 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 817 817 ) ); 818 $a3 = $this->factory->activity->create( array(818 $a3 = self::factory()->activity->create( array( 819 819 'user_id' => $u1, 820 820 'component' => 'activity', … … 823 823 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 824 824 ) ); 825 $a4 = $this->factory->activity->create( array(825 $a4 = self::factory()->activity->create( array( 826 826 'user_id' => $u1, 827 827 'component' => 'activity', … … 913 913 */ 914 914 function test_bp_has_activities_with_filter_query_compare_regex() { 915 $u1 = $this->factory->user->create();915 $u1 = self::factory()->user->create(); 916 916 917 917 $now = time(); 918 918 919 919 // misc activity items 920 $a1 = $this->factory->activity->create( array(920 $a1 = self::factory()->activity->create( array( 921 921 'user_id' => $u1, 922 922 'component' => 'blogs', … … 925 925 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 926 926 ) ); 927 $a2 = $this->factory->activity->create( array(927 $a2 = self::factory()->activity->create( array( 928 928 'user_id' => $u1, 929 929 'component' => 'blogs', … … 931 931 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 932 932 ) ); 933 $a3 = $this->factory->activity->create( array(933 $a3 = self::factory()->activity->create( array( 934 934 'user_id' => $u1, 935 935 'component' => 'activity', … … 937 937 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 938 938 ) ); 939 $a4 = $this->factory->activity->create( array(939 $a4 = self::factory()->activity->create( array( 940 940 'user_id' => $u1, 941 941 'component' => 'groups', … … 1003 1003 $reset_current_action = $bp->current_action; 1004 1004 1005 $u1 = $this->factory->user->create();1006 $u2 = $this->factory->user->create();1007 $u3 = $this->factory->user->create();1005 $u1 = self::factory()->user->create(); 1006 $u2 = self::factory()->user->create(); 1007 $u3 = self::factory()->user->create(); 1008 1008 1009 1009 $this->set_current_user( $u1 ); 1010 1010 1011 $g = $this->factory->group->create( array(1011 $g = self::factory()->group->create( array( 1012 1012 'status' => 'private', 1013 1013 ) ); … … 1016 1016 groups_join_group( $g, $u3 ); 1017 1017 1018 $a1 = $this->factory->activity->create( array(1018 $a1 = self::factory()->activity->create( array( 1019 1019 'component' => $bp->groups->id, 1020 1020 'item_id' => $g, … … 1024 1024 ) ); 1025 1025 1026 $a2 = $this->factory->activity->create( array(1026 $a2 = self::factory()->activity->create( array( 1027 1027 'component' => $bp->groups->id, 1028 1028 'item_id' => $g, … … 1057 1057 $reset_current_action = $bp->current_action; 1058 1058 1059 $u1 = $this->factory->user->create();1060 $u2 = $this->factory->user->create();1061 $u3 = $this->factory->user->create();1059 $u1 = self::factory()->user->create(); 1060 $u2 = self::factory()->user->create(); 1061 $u3 = self::factory()->user->create(); 1062 1062 1063 1063 $this->set_current_user( $u1 ); 1064 1064 1065 $g = $this->factory->group->create( array(1065 $g = self::factory()->group->create( array( 1066 1066 'status' => 'hidden', 1067 1067 ) ); … … 1070 1070 groups_join_group( $g, $u3 ); 1071 1071 1072 $a1 = $this->factory->activity->create( array(1072 $a1 = self::factory()->activity->create( array( 1073 1073 'component' => $bp->groups->id, 1074 1074 'item_id' => $g, … … 1078 1078 ) ); 1079 1079 1080 $a2 = $this->factory->activity->create( array(1080 $a2 = self::factory()->activity->create( array( 1081 1081 'component' => $bp->groups->id, 1082 1082 'item_id' => $g, … … 1105 1105 */ 1106 1106 function test_bp_has_activities_with_meta_query() { 1107 $a1 = $this->factory->activity->create();1108 $a2 = $this->factory->activity->create();1107 $a1 = self::factory()->activity->create(); 1108 $a2 = self::factory()->activity->create(); 1109 1109 bp_activity_update_meta( $a1, 'foo', 'bar' ); 1110 1110 … … 1129 1129 public function test_bp_has_activities_with_display_comments_false() { 1130 1130 $now = time(); 1131 $a1 = $this->factory->activity->create( array(1131 $a1 = self::factory()->activity->create( array( 1132 1132 'content' => 'Life Rules', 1133 1133 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1134 1134 ) ); 1135 $a2 = $this->factory->activity->create( array(1135 $a2 = self::factory()->activity->create( array( 1136 1136 'content' => 'Life Drools', 1137 1137 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1159 1159 public function test_bp_has_activities_with_display_comments_0() { 1160 1160 $now = time(); 1161 $a1 = $this->factory->activity->create( array(1161 $a1 = self::factory()->activity->create( array( 1162 1162 'content' => 'Life Rules', 1163 1163 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1164 1164 ) ); 1165 $a2 = $this->factory->activity->create( array(1165 $a2 = self::factory()->activity->create( array( 1166 1166 'content' => 'Life Drools', 1167 1167 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1189 1189 public function test_bp_has_activities_with_display_comments_0_querystring() { 1190 1190 $now = time(); 1191 $a1 = $this->factory->activity->create( array(1191 $a1 = self::factory()->activity->create( array( 1192 1192 'content' => 'Life Rules', 1193 1193 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1194 1194 ) ); 1195 $a2 = $this->factory->activity->create( array(1195 $a2 = self::factory()->activity->create( array( 1196 1196 'content' => 'Life Drools', 1197 1197 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1217 1217 public function test_bp_has_activities_with_display_comments_none_querystring() { 1218 1218 $now = time(); 1219 $a1 = $this->factory->activity->create( array(1219 $a1 = self::factory()->activity->create( array( 1220 1220 'content' => 'Life Rules', 1221 1221 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1222 1222 ) ); 1223 $a2 = $this->factory->activity->create( array(1223 $a2 = self::factory()->activity->create( array( 1224 1224 'content' => 'Life Drools', 1225 1225 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1245 1245 public function test_bp_has_activities_with_update_meta_cache_false() { 1246 1246 $now = time(); 1247 $a1 = $this->factory->activity->create( array(1247 $a1 = self::factory()->activity->create( array( 1248 1248 'content' => 'Life Rules', 1249 1249 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1250 1250 ) ); 1251 $a2 = $this->factory->activity->create( array(1251 $a2 = self::factory()->activity->create( array( 1252 1252 'content' => 'Life Drools', 1253 1253 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1272 1272 public function test_bp_has_activities_with_update_meta_cache_true() { 1273 1273 $now = time(); 1274 $a1 = $this->factory->activity->create( array(1274 $a1 = self::factory()->activity->create( array( 1275 1275 'content' => 'Life Rules', 1276 1276 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 1277 1277 ) ); 1278 $a2 = $this->factory->activity->create( array(1278 $a2 = self::factory()->activity->create( array( 1279 1279 'content' => 'Life Drools', 1280 1280 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 1300 1300 add_filter( 'bp_disable_blogforum_comments', '__return_false' ); 1301 1301 1302 $u = $this->factory->user->create();1303 1304 $now = time(); 1305 $a1 = $this->factory->activity->create( array(1302 $u = self::factory()->user->create(); 1303 1304 $now = time(); 1305 $a1 = self::factory()->activity->create( array( 1306 1306 'content' => 'Life Rules', 1307 1307 'component' => 'blogs', … … 1310 1310 'user_id' => $u, 1311 1311 ) ); 1312 $a2 = $this->factory->activity->create( array(1312 $a2 = self::factory()->activity->create( array( 1313 1313 'content' => 'Life Drools', 1314 1314 'component' => 'blogs', … … 1327 1327 ) ); 1328 1328 1329 $a4 = $this->factory->activity->create( array(1329 $a4 = self::factory()->activity->create( array( 1330 1330 'content' => 'Life Rulez', 1331 1331 'component' => 'activity', … … 1513 1513 */ 1514 1514 public function test_bp_activity_has_more_items_no_count_total_false() { 1515 $a1 = $this->factory->activity->create();1516 $a2 = $this->factory->activity->create();1515 $a1 = self::factory()->activity->create(); 1516 $a2 = self::factory()->activity->create(); 1517 1517 1518 1518 $args = array( … … 1531 1531 */ 1532 1532 public function test_bp_activity_has_more_items_no_count_total_true() { 1533 $a1 = $this->factory->activity->create();1534 $a2 = $this->factory->activity->create();1535 $a3 = $this->factory->activity->create();1536 $a4 = $this->factory->activity->create();1533 $a1 = self::factory()->activity->create(); 1534 $a2 = self::factory()->activity->create(); 1535 $a3 = self::factory()->activity->create(); 1536 $a4 = self::factory()->activity->create(); 1537 1537 1538 1538 $args = array( … … 1552 1552 */ 1553 1553 public function test_bp_activity_has_more_items_count_total_false() { 1554 $a1 = $this->factory->activity->create();1555 $a2 = $this->factory->activity->create();1556 $a3 = $this->factory->activity->create();1557 $a4 = $this->factory->activity->create();1554 $a1 = self::factory()->activity->create(); 1555 $a2 = self::factory()->activity->create(); 1556 $a3 = self::factory()->activity->create(); 1557 $a4 = self::factory()->activity->create(); 1558 1558 1559 1559 $args = array( … … 1572 1572 */ 1573 1573 public function test_bp_activity_has_more_items_count_total_true() { 1574 $a1 = $this->factory->activity->create();1575 $a2 = $this->factory->activity->create();1576 $a3 = $this->factory->activity->create();1577 $a4 = $this->factory->activity->create();1574 $a1 = self::factory()->activity->create(); 1575 $a2 = self::factory()->activity->create(); 1576 $a3 = self::factory()->activity->create(); 1577 $a4 = self::factory()->activity->create(); 1578 1578 1579 1579 $args = array( … … 1600 1600 } 1601 1601 1602 $a1 = $this->factory->activity->create();1603 $a2 = $this->factory->activity->create( array(1602 $a1 = self::factory()->activity->create(); 1603 $a2 = self::factory()->activity->create( array( 1604 1604 'recorded_time' => '2001-01-01 12:00' 1605 1605 ) ); 1606 $a3 = $this->factory->activity->create( array(1606 $a3 = self::factory()->activity->create( array( 1607 1607 'recorded_time' => '2005-01-01 12:00' 1608 1608 ) );
Note: See TracChangeset
for help on using the changeset viewer.