- Timestamp:
- 11/03/2024 06:19:06 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/friends/test-controller.php
r14026 r14070 39 39 $this->create_friendship(); 40 40 41 $this->bp::set_current_user( $this->user );41 wp_set_current_user( $this->user ); 42 42 43 43 $request = new WP_REST_Request( 'GET', $this->endpoint_url ); … … 76 76 */ 77 77 public function test_get_item() { 78 $this->bp::set_current_user( $this->user );78 wp_set_current_user( $this->user ); 79 79 80 80 $request = new WP_REST_Request( 'GET', sprintf( $this->endpoint_url . '/%d', $this->friend ) ); … … 97 97 */ 98 98 public function test_get_item_with_invalid_friend_id() { 99 $this->bp::set_current_user( $this->user );99 wp_set_current_user( $this->user ); 100 100 101 101 $request = new WP_REST_Request( 'GET', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 121 121 */ 122 122 public function test_create_item() { 123 $this->bp::set_current_user( $this->user );123 wp_set_current_user( $this->user ); 124 124 125 125 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 145 145 $u2 = static::factory()->user->create(); 146 146 147 $this->bp::set_current_user( $u2 );147 wp_set_current_user( $u2 ); 148 148 149 149 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 167 167 $u = static::factory()->user->create(); 168 168 169 $this->bp::set_current_user( $this->user );169 wp_set_current_user( $this->user ); 170 170 171 171 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 190 190 191 191 $this->create_friendship( $user ); 192 $this->bp::set_current_user( $this->user );192 wp_set_current_user( $this->user ); 193 193 194 194 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 224 224 */ 225 225 public function test_regular_user_can_not_create_friendship_to_others() { 226 $this->bp::set_current_user( static::factory()->user->create() );226 wp_set_current_user( static::factory()->user->create() ); 227 227 228 228 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 240 240 */ 241 241 public function test_admins_can_create_friendship_to_others() { 242 $this->bp::set_current_user( $this->user );242 wp_set_current_user( $this->user ); 243 243 244 244 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 260 260 */ 261 261 public function test_admins_can_force_friendship_creation() { 262 $this->bp::set_current_user( $this->user );262 wp_set_current_user( $this->user ); 263 263 264 264 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 282 282 public function test_regular_users_can_not_force_friendship_creation() { 283 283 $u = static::factory()->user->create(); 284 $this->bp::set_current_user( $u );284 wp_set_current_user( $u ); 285 285 286 286 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 335 335 $this->create_friendship(); 336 336 337 $this->bp::set_current_user( $this->friend );337 wp_set_current_user( $this->friend ); 338 338 339 339 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->user ) ); … … 353 353 $this->create_friendship(); 354 354 355 $this->bp::set_current_user( $this->user );355 wp_set_current_user( $this->user ); 356 356 357 357 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->friend ) ); … … 365 365 */ 366 366 public function test_update_item_invalid_friend_id() { 367 $this->bp::set_current_user( $this->user );367 wp_set_current_user( $this->user ); 368 368 369 369 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 389 389 $this->create_friendship(); 390 390 391 $this->bp::set_current_user( $this->friend );391 wp_set_current_user( $this->friend ); 392 392 393 393 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->user ) ); … … 407 407 $this->create_friendship(); 408 408 409 $this->bp::set_current_user( $this->user );409 wp_set_current_user( $this->user ); 410 410 411 411 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->friend ) ); … … 425 425 $this->create_friendship(); 426 426 427 $this->bp::set_current_user( $this->friend );427 wp_set_current_user( $this->friend ); 428 428 429 429 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->user ) ); … … 444 444 $this->create_friendship(); 445 445 446 $this->bp::set_current_user( $this->user );446 wp_set_current_user( $this->user ); 447 447 448 448 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->friend ) ); … … 463 463 $this->create_friendship(); 464 464 465 $this->bp::set_current_user( $this->user );465 wp_set_current_user( $this->user ); 466 466 467 467 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->friend ) ); … … 482 482 $this->create_friendship(); 483 483 484 $this->bp::set_current_user( $this->friend );484 wp_set_current_user( $this->friend ); 485 485 486 486 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->user ) ); … … 500 500 $this->create_friendship(); 501 501 502 $this->bp::set_current_user( $this->friend );502 wp_set_current_user( $this->friend ); 503 503 504 504 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 522 522 */ 523 523 public function test_prepare_item() { 524 $this->bp::set_current_user( $this->user );524 wp_set_current_user( $this->user ); 525 525 526 526 $request = new WP_REST_Request( 'GET', sprintf( $this->endpoint_url . '/%d', $this->friend ) );
Note: See TracChangeset
for help on using the changeset viewer.