Changeset 11737 for trunk/tests/phpunit/testcases/friends/functions.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/friends/functions.php
r11354 r11737 20 20 */ 21 21 public function test_requests_on_accept() { 22 $u1 = $this->factory->user->create();23 $u2 = $this->factory->user->create();24 $u3 = $this->factory->user->create();22 $u1 = self::factory()->user->create(); 23 $u2 = self::factory()->user->create(); 24 $u3 = self::factory()->user->create(); 25 25 26 26 // request friendship … … 55 55 */ 56 56 public function test_requests_on_request() { 57 $u1 = $this->factory->user->create();58 $u2 = $this->factory->user->create();59 $u3 = $this->factory->user->create();57 $u1 = self::factory()->user->create(); 58 $u2 = self::factory()->user->create(); 59 $u3 = self::factory()->user->create(); 60 60 61 61 // request friendship … … 85 85 */ 86 86 public function test_requests_on_withdraw() { 87 $u1 = $this->factory->user->create();88 $u2 = $this->factory->user->create();87 $u1 = self::factory()->user->create(); 88 $u2 = self::factory()->user->create(); 89 89 90 90 // request friendship … … 113 113 */ 114 114 public function test_requests_on_reject() { 115 $u1 = $this->factory->user->create();116 $u2 = $this->factory->user->create();115 $u1 = self::factory()->user->create(); 116 $u2 = self::factory()->user->create(); 117 117 118 118 // request friendship … … 139 139 */ 140 140 public function test_friends_add_friend_fail_on_self() { 141 $u1 = $this->factory->user->create();141 $u1 = self::factory()->user->create(); 142 142 $this->assertFalse( friends_add_friend( $u1, $u1 ) ); 143 143 } … … 147 147 */ 148 148 public function test_friends_add_friend_already_friends() { 149 $u1 = $this->factory->user->create();150 $u2 = $this->factory->user->create();149 $u1 = self::factory()->user->create(); 150 $u2 = self::factory()->user->create(); 151 151 152 152 friends_add_friend( $u1, $u2, true ); … … 160 160 public function test_friends_check_friendship_status_in_members_loop() { 161 161 $now = time(); 162 $u1 = $this->factory->user->create( array(162 $u1 = self::factory()->user->create( array( 163 163 'last_activity' => date( 'Y-m-d H:i:s', $now ), 164 164 ) ); 165 $u2 = $this->factory->user->create( array(165 $u2 = self::factory()->user->create( array( 166 166 'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ), 167 167 ) ); 168 $u3 = $this->factory->user->create( array(168 $u3 = self::factory()->user->create( array( 169 169 'last_activity' => date( 'Y-m-d H:i:s', $now - 200 ), 170 170 ) ); 171 $u4 = $this->factory->user->create( array(171 $u4 = self::factory()->user->create( array( 172 172 'last_activity' => date( 'Y-m-d H:i:s', $now - 300 ), 173 173 ) ); 174 $u5 = $this->factory->user->create( array(174 $u5 = self::factory()->user->create( array( 175 175 'last_activity' => date( 'Y-m-d H:i:s', $now - 400 ), 176 176 ) ); … … 208 208 public function test_friends_check_friendship_status_not_in_members_loop() { 209 209 $now = time(); 210 $u1 = $this->factory->user->create( array(210 $u1 = self::factory()->user->create( array( 211 211 'last_activity' => date( 'Y-m-d H:i:s', $now ), 212 212 ) ); 213 $u2 = $this->factory->user->create( array(213 $u2 = self::factory()->user->create( array( 214 214 'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ), 215 215 ) ); 216 $u3 = $this->factory->user->create( array(216 $u3 = self::factory()->user->create( array( 217 217 'last_activity' => date( 'Y-m-d H:i:s', $now - 200 ), 218 218 ) ); 219 $u4 = $this->factory->user->create( array(219 $u4 = self::factory()->user->create( array( 220 220 'last_activity' => date( 'Y-m-d H:i:s', $now - 300 ), 221 221 ) ); 222 $u5 = $this->factory->user->create( array(222 $u5 = self::factory()->user->create( array( 223 223 'last_activity' => date( 'Y-m-d H:i:s', $now - 400 ), 224 224 ) ); … … 251 251 */ 252 252 public function test_friends_add_friend_friends_friendship_requested() { 253 $u1 = $this->factory->user->create();254 $u2 = $this->factory->user->create();253 $u1 = self::factory()->user->create(); 254 $u2 = self::factory()->user->create(); 255 255 256 256 add_filter( 'friends_friendship_requested', array( $this, 'friends_friendship_filter_callback' ) ); … … 265 265 */ 266 266 public function test_friends_add_friend_friends_friendship_accepted() { 267 $u1 = $this->factory->user->create();268 $u2 = $this->factory->user->create();267 $u1 = self::factory()->user->create(); 268 $u2 = self::factory()->user->create(); 269 269 270 270 add_filter( 'friends_friendship_accepted', array( $this, 'friends_friendship_filter_callback' ) ); … … 286 286 global $wpdb; 287 287 $now = time(); 288 $u1 = $this->factory->user->create( array(288 $u1 = self::factory()->user->create( array( 289 289 'last_activity' => date( 'Y-m-d H:i:s', $now ), 290 290 ) ); 291 $u2 = $this->factory->user->create( array(291 $u2 = self::factory()->user->create( array( 292 292 'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ), 293 293 ) ); 294 $u3 = $this->factory->user->create( array(294 $u3 = self::factory()->user->create( array( 295 295 'last_activity' => date( 'Y-m-d H:i:s', $now - 200 ), 296 296 ) ); … … 313 313 global $wpdb; 314 314 $now = time(); 315 $u1 = $this->factory->user->create( array(315 $u1 = self::factory()->user->create( array( 316 316 'last_activity' => date( 'Y-m-d H:i:s', $now ), 317 317 ) ); 318 $u2 = $this->factory->user->create( array(318 $u2 = self::factory()->user->create( array( 319 319 'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ), 320 320 ) ); … … 335 335 336 336 public function test_friends_get_recently_active() { 337 $u1 = $this->factory->user->create();338 $u2 = $this->factory->user->create();339 $u3 = $this->factory->user->create();340 $u4 = $this->factory->user->create();337 $u1 = self::factory()->user->create(); 338 $u2 = self::factory()->user->create(); 339 $u3 = self::factory()->user->create(); 340 $u4 = self::factory()->user->create(); 341 341 342 342 // request friendship … … 357 357 358 358 public function test_friends_get_alphabetically() { 359 $u1 = $this->factory->user->create();360 $u2 = $this->factory->user->create();361 $u3 = $this->factory->user->create();359 $u1 = self::factory()->user->create(); 360 $u2 = self::factory()->user->create(); 361 $u3 = self::factory()->user->create(); 362 362 363 363 // request friendship … … 378 378 379 379 public function test_friends_get_newest() { 380 $u1 = $this->factory->user->create();381 $u2 = $this->factory->user->create();382 $u3 = $this->factory->user->create();383 $u4 = $this->factory->user->create();380 $u1 = self::factory()->user->create(); 381 $u2 = self::factory()->user->create(); 382 $u3 = self::factory()->user->create(); 383 $u4 = self::factory()->user->create(); 384 384 385 385 // request friendship
Note: See TracChangeset
for help on using the changeset viewer.