- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/messages/class.bp-messages-thread.php
r11044 r11737 11 11 */ 12 12 public function test_construct_cache() { 13 $u1 = $this->factory->user->create();14 $u2 = $this->factory->user->create();15 16 $message = $this->factory->message->create_and_get( array(13 $u1 = self::factory()->user->create(); 14 $u2 = self::factory()->user->create(); 15 16 $message = self::factory()->message->create_and_get( array( 17 17 'sender_id' => $u1, 18 18 'recipients' => array( $u2 ), … … 35 35 */ 36 36 public function test_construct_order_desc() { 37 $u1 = $this->factory->user->create();38 $u2 = $this->factory->user->create();37 $u1 = self::factory()->user->create(); 38 $u2 = self::factory()->user->create(); 39 39 40 40 // create thread 41 $message_1 = $this->factory->message->create_and_get( array(41 $message_1 = self::factory()->message->create_and_get( array( 42 42 'sender_id' => $u1, 43 43 'recipients' => array( $u2 ), … … 47 47 48 48 // create reply 49 $message_2 = $this->factory->message->create_and_get( array(49 $message_2 = self::factory()->message->create_and_get( array( 50 50 'thread_id' => $message_1->thread_id, 51 51 'sender_id' => $u1, … … 69 69 */ 70 70 public function test_get_current_threads_for_user_with_search_terms_inbox() { 71 $u1 = $this->factory->user->create();72 $u2 = $this->factory->user->create();73 74 $message_1 = $this->factory->message->create_and_get( array(75 'sender_id' => $u1, 76 'recipients' => array( $u2 ), 77 'subject' => 'Foo', 78 ) ); 79 80 $message_2 = $this->factory->message->create_and_get( array(71 $u1 = self::factory()->user->create(); 72 $u2 = self::factory()->user->create(); 73 74 $message_1 = self::factory()->message->create_and_get( array( 75 'sender_id' => $u1, 76 'recipients' => array( $u2 ), 77 'subject' => 'Foo', 78 ) ); 79 80 $message_2 = self::factory()->message->create_and_get( array( 81 81 'sender_id' => $u1, 82 82 'recipients' => array( $u2 ), … … 99 99 */ 100 100 public function test_get_current_threads_for_user_with_search_terms_sentbox() { 101 $u1 = $this->factory->user->create();102 $u2 = $this->factory->user->create();103 104 $message_1 = $this->factory->message->create_and_get( array(105 'sender_id' => $u1, 106 'recipients' => array( $u2 ), 107 'subject' => 'Foo', 108 ) ); 109 110 $message_2 = $this->factory->message->create_and_get( array(101 $u1 = self::factory()->user->create(); 102 $u2 = self::factory()->user->create(); 103 104 $message_1 = self::factory()->message->create_and_get( array( 105 'sender_id' => $u1, 106 'recipients' => array( $u2 ), 107 'subject' => 'Foo', 108 ) ); 109 110 $message_2 = self::factory()->message->create_and_get( array( 111 111 'sender_id' => $u1, 112 112 'recipients' => array( $u2 ), … … 131 131 */ 132 132 public function test_get_current_threads_for_user_with_old_args() { 133 $u1 = $this->factory->user->create();134 $u2 = $this->factory->user->create();135 136 $message_1 = $this->factory->message->create_and_get( array(137 'sender_id' => $u1, 138 'recipients' => array( $u2 ), 139 'subject' => 'Foo', 140 ) ); 141 142 $message_2 = $this->factory->message->create_and_get( array(133 $u1 = self::factory()->user->create(); 134 $u2 = self::factory()->user->create(); 135 136 $message_1 = self::factory()->message->create_and_get( array( 137 'sender_id' => $u1, 138 'recipients' => array( $u2 ), 139 'subject' => 'Foo', 140 ) ); 141 142 $message_2 = self::factory()->message->create_and_get( array( 143 143 'sender_id' => $u1, 144 144 'recipients' => array( $u2 ), … … 161 161 global $wpdb; 162 162 163 $u1 = $this->factory->user->create();164 $u2 = $this->factory->user->create();165 166 $message = $this->factory->message->create_and_get( array(163 $u1 = self::factory()->user->create(); 164 $u2 = self::factory()->user->create(); 165 166 $message = self::factory()->message->create_and_get( array( 167 167 'sender_id' => $u1, 168 168 'recipients' => array( $u2 ), … … 187 187 global $wpdb; 188 188 189 $u1 = $this->factory->user->create();190 $u2 = $this->factory->user->create();191 192 $message = $this->factory->message->create_and_get( array(189 $u1 = self::factory()->user->create(); 190 $u2 = self::factory()->user->create(); 191 192 $message = self::factory()->message->create_and_get( array( 193 193 'sender_id' => $u1, 194 194 'recipients' => array( $u2 ), … … 225 225 global $wpdb; 226 226 227 $u1 = $this->factory->user->create();228 $u2 = $this->factory->user->create();229 230 $message = $this->factory->message->create_and_get( array(227 $u1 = self::factory()->user->create(); 228 $u2 = self::factory()->user->create(); 229 230 $message = self::factory()->message->create_and_get( array( 231 231 'sender_id' => $u1, 232 232 'recipients' => array( $u2 ), … … 257 257 global $wpdb; 258 258 259 $u1 = $this->factory->user->create();260 $u2 = $this->factory->user->create();261 262 $message = $this->factory->message->create_and_get( array(259 $u1 = self::factory()->user->create(); 260 $u2 = self::factory()->user->create(); 261 262 $message = self::factory()->message->create_and_get( array( 263 263 'sender_id' => $u1, 264 264 'recipients' => array( $u2 ), … … 289 289 global $wpdb; 290 290 291 $u1 = $this->factory->user->create();292 $u2 = $this->factory->user->create();293 294 $message = $this->factory->message->create_and_get( array(291 $u1 = self::factory()->user->create(); 292 $u2 = self::factory()->user->create(); 293 294 $message = self::factory()->message->create_and_get( array( 295 295 'sender_id' => $u1, 296 296 'recipients' => array( $u2 ), … … 326 326 global $wpdb; 327 327 328 $u1 = $this->factory->user->create();329 $u2 = $this->factory->user->create();330 331 $message = $this->factory->message->create_and_get( array(328 $u1 = self::factory()->user->create(); 329 $u2 = self::factory()->user->create(); 330 331 $message = self::factory()->message->create_and_get( array( 332 332 'sender_id' => $u1, 333 333 'recipients' => array( $u2 ), … … 360 360 */ 361 361 public function test_check_access_valid_thread() { 362 $u1 = $this->factory->user->create();363 $u2 = $this->factory->user->create();364 365 $message = $this->factory->message->create_and_get( array(362 $u1 = self::factory()->user->create(); 363 $u2 = self::factory()->user->create(); 364 365 $message = self::factory()->message->create_and_get( array( 366 366 'sender_id' => $u1, 367 367 'recipients' => array( $u2 ), … … 390 390 */ 391 391 public function test_is_valid_valid_thread() { 392 $u1 = $this->factory->user->create();393 $u2 = $this->factory->user->create();394 395 $message = $this->factory->message->create_and_get( array(392 $u1 = self::factory()->user->create(); 393 $u2 = self::factory()->user->create(); 394 395 $message = self::factory()->message->create_and_get( array( 396 396 'sender_id' => $u1, 397 397 'recipients' => array( $u2 ), … … 415 415 */ 416 416 public function test_last_message_populated() { 417 $u1 = $this->factory->user->create();418 $u2 = $this->factory->user->create();417 $u1 = self::factory()->user->create(); 418 $u2 = self::factory()->user->create(); 419 419 420 420 $date = bp_core_current_time(); 421 421 422 $message = $this->factory->message->create_and_get( array(422 $message = self::factory()->message->create_and_get( array( 423 423 'sender_id' => $u1, 424 424 'recipients' => array( $u2 ),
Note: See TracChangeset
for help on using the changeset viewer.