- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/class.BP_Activity_Activity.php
r11312 r11737 10 10 public function test_check_exists_by_content() { 11 11 $content = 'A classy girl who know how to enjoy the freedom of a cup of coffee'; 12 $activity = $this->factory->activity->create( array(12 $activity = self::factory()->activity->create( array( 13 13 'content' => $content, 14 14 'type' => 'activity_update', … … 23 23 */ 24 24 public function test_delete_activity_item_comments() { 25 $parent_activity = $this->factory->activity->create( array(25 $parent_activity = self::factory()->activity->create( array( 26 26 'type' => 'activity_update', 27 27 ) ); 28 28 29 $comments = $this->factory->activity->create_many( 3, array(29 $comments = self::factory()->activity->create_many( 3, array( 30 30 'item_id' => $parent_activity, 31 31 'type' => 'activity_comment', … … 44 44 */ 45 45 public function test_delete_activity_meta_entries() { 46 $activity = $this->factory->activity->create( array(46 $activity = self::factory()->activity->create( array( 47 47 'type' => 'activity_update', 48 48 ) ); … … 61 61 */ 62 62 public function test_get_with_fields_parameter_by_id() { 63 $a = $this->factory->activity->create_many( 3, array(63 $a = self::factory()->activity->create_many( 3, array( 64 64 'type' => 'activity_update', 65 65 ) ); … … 75 75 */ 76 76 public function test_hide_all_for_user() { 77 $activity = $this->factory->activity->create( array(77 $activity = self::factory()->activity->create( array( 78 78 'type' => 'activity_update', 79 79 ) ); … … 93 93 */ 94 94 public function test_get_with_meta_query() { 95 $a1 = $this->factory->activity->create();96 $a2 = $this->factory->activity->create();95 $a1 = self::factory()->activity->create(); 96 $a2 = self::factory()->activity->create(); 97 97 bp_activity_update_meta( $a1, 'foo', 'bar' ); 98 98 … … 114 114 public function test_get_with_meta_query_two_clauses_with_or_relation() { 115 115 $now = time(); 116 $a1 = $this->factory->activity->create( array(116 $a1 = self::factory()->activity->create( array( 117 117 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 118 118 ) ); 119 $a2 = $this->factory->activity->create( array(119 $a2 = self::factory()->activity->create( array( 120 120 'recorded_time' => date( 'Y-m-d H:i:s', $now - 60 ), 121 121 ) ); 122 $a3 = $this->factory->activity->create( array(122 $a3 = self::factory()->activity->create( array( 123 123 'recorded_time' => date( 'Y-m-d H:i:s', $now - 120 ), 124 124 ) ); … … 157 157 } 158 158 159 $a1 = $this->factory->activity->create();160 $a2 = $this->factory->activity->create( array(159 $a1 = self::factory()->activity->create(); 160 $a2 = self::factory()->activity->create( array( 161 161 'recorded_time' => '2001-01-01 12:00' 162 162 ) ); 163 $a3 = $this->factory->activity->create( array(163 $a3 = self::factory()->activity->create( array( 164 164 'recorded_time' => '2005-01-01 12:00' 165 165 ) ); … … 188 188 } 189 189 190 $a1 = $this->factory->activity->create();191 $a2 = $this->factory->activity->create( array(190 $a1 = self::factory()->activity->create(); 191 $a2 = self::factory()->activity->create( array( 192 192 'recorded_time' => '2001-01-01 12:00' 193 193 ) ); 194 $a3 = $this->factory->activity->create( array(194 $a3 = self::factory()->activity->create( array( 195 195 'recorded_time' => '2005-01-01 12:00' 196 196 ) ); … … 221 221 } 222 222 223 $a1 = $this->factory->activity->create();224 $a2 = $this->factory->activity->create( array(223 $a1 = self::factory()->activity->create(); 224 $a2 = self::factory()->activity->create( array( 225 225 'recorded_time' => '2001-01-01 12:00' 226 226 ) ); 227 $a3 = $this->factory->activity->create( array(227 $a3 = self::factory()->activity->create( array( 228 228 'recorded_time' => '2005-01-01 12:00' 229 229 ) ); … … 242 242 */ 243 243 public function test_get_with_search_terms() { 244 $a1 = $this->factory->activity->create( array(244 $a1 = self::factory()->activity->create( array( 245 245 'content' => 'Boone is a cool guy', 246 246 ) ); 247 $a2 = $this->factory->activity->create( array(247 $a2 = self::factory()->activity->create( array( 248 248 'content' => 'No he isn\'t', 249 249 ) ); … … 260 260 */ 261 261 public function test_get_with_display_comments_threaded() { 262 $u = $this->factory->user->create();262 $u = self::factory()->user->create(); 263 263 264 264 $now = time(); 265 $a1 = $this->factory->activity->create( array(265 $a1 = self::factory()->activity->create( array( 266 266 'user_id' => $u, 267 267 'content' => 'Life Rules', 268 268 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 269 269 ) ); 270 $a2 = $this->factory->activity->create( array(270 $a2 = self::factory()->activity->create( array( 271 271 'user_id' => $u, 272 272 'content' => 'Life Drools', … … 303 303 public function test_get_with_display_comments_stream() { 304 304 $now = time(); 305 $a1 = $this->factory->activity->create( array(305 $a1 = self::factory()->activity->create( array( 306 306 'content' => 'Life Rules', 307 307 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 308 308 ) ); 309 $a2 = $this->factory->activity->create( array(309 $a2 = self::factory()->activity->create( array( 310 310 'content' => 'Life Drools', 311 311 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 336 336 public function test_get_with_display_comments_false() { 337 337 $now = time(); 338 $a1 = $this->factory->activity->create( array(338 $a1 = self::factory()->activity->create( array( 339 339 'content' => 'Life Rules', 340 340 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 341 341 ) ); 342 $a2 = $this->factory->activity->create( array(342 $a2 = self::factory()->activity->create( array( 343 343 'content' => 'Life Drools', 344 344 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), … … 362 362 public function test_get_with_offset() { 363 363 $now = time(); 364 $a1 = $this->factory->activity->create( array(364 $a1 = self::factory()->activity->create( array( 365 365 'content' => 'Life Rules', 366 366 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 367 367 ) ); 368 $a2 = $this->factory->activity->create( array(368 $a2 = self::factory()->activity->create( array( 369 369 'content' => 'Life Drools', 370 370 'recorded_time' => date( 'Y-m-d H:i:s', $now - 50 ), 371 371 ) ); 372 $a3 = $this->factory->activity->create( array(372 $a3 = self::factory()->activity->create( array( 373 373 'content' => 'Life Drools', 374 374 'recorded_time' => date( 'Y-m-d H:i:s', $now - 10 ), … … 389 389 public function test_get_with_since() { 390 390 $now = time(); 391 $a1 = $this->factory->activity->create( array(391 $a1 = self::factory()->activity->create( array( 392 392 'content' => 'Life Rules', 393 393 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 394 394 ) ); 395 $a2 = $this->factory->activity->create( array(395 $a2 = self::factory()->activity->create( array( 396 396 'content' => 'Life Drools', 397 397 'recorded_time' => date( 'Y-m-d H:i:s', $now - 50 ), 398 398 ) ); 399 $a3 = $this->factory->activity->create( array(399 $a3 = self::factory()->activity->create( array( 400 400 'content' => 'Life Drools', 401 401 'recorded_time' => date( 'Y-m-d H:i:s', $now - 10 ), … … 416 416 */ 417 417 public function test_get_with_count_total() { 418 $a1 = $this->factory->activity->create();419 $a2 = $this->factory->activity->create();418 $a1 = self::factory()->activity->create(); 419 $a2 = self::factory()->activity->create(); 420 420 421 421 $activity = BP_Activity_Activity::get( array( … … 431 431 */ 432 432 public function test_get_with_count_total_false() { 433 $a1 = $this->factory->activity->create();434 $a2 = $this->factory->activity->create();433 $a1 = self::factory()->activity->create(); 434 $a2 = self::factory()->activity->create(); 435 435 436 436 $activity = BP_Activity_Activity::get( array( … … 446 446 */ 447 447 public function test_get_with_count_total_default_to_false() { 448 $a1 = $this->factory->activity->create();449 $a2 = $this->factory->activity->create();448 $a1 = self::factory()->activity->create(); 449 $a2 = self::factory()->activity->create(); 450 450 451 451 $activity = BP_Activity_Activity::get(); … … 458 458 */ 459 459 public function test_get_id_with_item_id() { 460 $a1 = $this->factory->activity->create( array(460 $a1 = self::factory()->activity->create( array( 461 461 'item_id' => 523, 462 462 ) ); 463 $a2 = $this->factory->activity->create( array(463 $a2 = self::factory()->activity->create( array( 464 464 'item_id' => 1888, 465 465 ) ); … … 473 473 */ 474 474 public function test_get_id_with_secondary_item_id() { 475 $a1 = $this->factory->activity->create( array(475 $a1 = self::factory()->activity->create( array( 476 476 'secondary_item_id' => 523, 477 477 ) ); 478 $a2 = $this->factory->activity->create( array(478 $a2 = self::factory()->activity->create( array( 479 479 'secondary_content' => 1888, 480 480 ) ); … … 488 488 */ 489 489 public function test_delete_with_item_id() { 490 $a1 = $this->factory->activity->create( array(490 $a1 = self::factory()->activity->create( array( 491 491 'item_id' => 523, 492 492 ) ); 493 $a2 = $this->factory->activity->create( array(493 $a2 = self::factory()->activity->create( array( 494 494 'item_id' => 1888, 495 495 ) ); … … 505 505 */ 506 506 public function test_delete_with_secondary_item_id() { 507 $a1 = $this->factory->activity->create( array(507 $a1 = self::factory()->activity->create( array( 508 508 'secondary_item_id' => 523, 509 509 ) ); 510 $a2 = $this->factory->activity->create( array(510 $a2 = self::factory()->activity->create( array( 511 511 'secondary_item_id' => 1888, 512 512 ) ); … … 527 527 $now = time(); 528 528 529 $u1 = $this->factory->user->create();530 $u2 = $this->factory->user->create();531 532 $a1 = $this->factory->activity->create( array(529 $u1 = self::factory()->user->create(); 530 $u2 = self::factory()->user->create(); 531 532 $a1 = self::factory()->activity->create( array( 533 533 'content' => 'Life Rules', 534 534 'recorded_time' => date( 'Y-m-d H:i:s', $now ), … … 602 602 public function test_get_last_updated() { 603 603 $now = time(); 604 $a1 = $this->factory->activity->create( array(604 $a1 = self::factory()->activity->create( array( 605 605 'recorded_time' => date( 'Y-m-d H:i:s', $now - 500 ), 606 606 ) ); 607 $a2 = $this->factory->activity->create( array(607 $a2 = self::factory()->activity->create( array( 608 608 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 609 609 ) ); 610 $a3 = $this->factory->activity->create( array(610 $a3 = self::factory()->activity->create( array( 611 611 'recorded_time' => date( 'Y-m-d H:i:s', $now - 300 ), 612 612 ) ); … … 619 619 */ 620 620 public function test_get_recorded_components_skip_last_activity_false() { 621 $a1 = $this->factory->activity->create( array(621 $a1 = self::factory()->activity->create( array( 622 622 'component' => 'members', 623 623 'action' => 'last_activity', 624 624 ) ); 625 $a2 = $this->factory->activity->create( array(625 $a2 = self::factory()->activity->create( array( 626 626 'component' => 'groups', 627 627 'action' => 'created_group', 628 628 ) ); 629 $a3 = $this->factory->activity->create( array(629 $a3 = self::factory()->activity->create( array( 630 630 'component' => 'friends', 631 631 'action' => 'friendship_accepted', … … 642 642 */ 643 643 public function test_get_recorded_components_skip_last_activity_true_filter_empty_component() { 644 $a1 = $this->factory->activity->create( array(644 $a1 = self::factory()->activity->create( array( 645 645 'component' => 'members', 646 646 'action' => 'last_activity', 647 647 ) ); 648 $a2 = $this->factory->activity->create( array(648 $a2 = self::factory()->activity->create( array( 649 649 'component' => 'groups', 650 650 'action' => 'created_group', 651 651 ) ); 652 $a3 = $this->factory->activity->create( array(652 $a3 = self::factory()->activity->create( array( 653 653 'component' => 'friends', 654 654 'action' => 'friendship_accepted', … … 665 665 */ 666 666 public function test_get_recorded_components_skip_last_activity_true_members_component_not_empty() { 667 $a1 = $this->factory->activity->create( array(667 $a1 = self::factory()->activity->create( array( 668 668 'component' => 'members', 669 669 'action' => 'last_activity', 670 670 ) ); 671 $a2 = $this->factory->activity->create( array(671 $a2 = self::factory()->activity->create( array( 672 672 'component' => 'groups', 673 673 'action' => 'created_group', 674 674 ) ); 675 $a3 = $this->factory->activity->create( array(675 $a3 = self::factory()->activity->create( array( 676 676 'component' => 'friends', 677 677 'action' => 'friendship_accepted', 678 678 ) ); 679 $a4 = $this->factory->activity->create( array(679 $a4 = self::factory()->activity->create( array( 680 680 'component' => 'members', 681 681 'action' => 'foo', … … 692 692 */ 693 693 public function test_get_recorded_components_skip_last_activity_true_la_in_multiple_components() { 694 $a1 = $this->factory->activity->create( array(694 $a1 = self::factory()->activity->create( array( 695 695 'component' => 'members', 696 696 'action' => 'last_activity', 697 697 ) ); 698 $a2 = $this->factory->activity->create( array(698 $a2 = self::factory()->activity->create( array( 699 699 'component' => 'groups', 700 700 'action' => 'created_group', 701 701 ) ); 702 $a3 = $this->factory->activity->create( array(702 $a3 = self::factory()->activity->create( array( 703 703 'component' => 'friends', 704 704 'action' => 'friendship_accepted', 705 705 ) ); 706 $a4 = $this->factory->activity->create( array(706 $a4 = self::factory()->activity->create( array( 707 707 'component' => 'groups', 708 708 'action' => 'last_activity', … … 726 726 727 727 // Create the activity item with a manual activity string 728 $a = $this->factory->activity->create( array(728 $a = self::factory()->activity->create( array( 729 729 'component' => 'foo', 730 730 'type' => 'bar', … … 744 744 745 745 // Create the activity item with a manual activity string 746 $a = $this->factory->activity->create( array(746 $a = self::factory()->activity->create( array( 747 747 'component' => 'foo', 748 748 'type' => 'bar1', … … 762 762 763 763 // Create the activity item with a manual activity string 764 $a = $this->factory->activity->create( array(764 $a = self::factory()->activity->create( array( 765 765 'component' => 'foo', 766 766 'type' => 'bar2', … … 776 776 */ 777 777 public function test_nonexistent_activity_should_have_id_0_after_population() { 778 $a = $this->factory->activity->create();778 $a = self::factory()->activity->create(); 779 779 bp_activity_delete_by_activity_id( $a ); 780 780
Note: See TracChangeset
for help on using the changeset viewer.