- Timestamp:
- 11/03/2024 06:19:06 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/xprofile/test-xprofile-field-controller.php
r14026 r14070 35 35 */ 36 36 public function test_get_items() { 37 $this->bp::set_current_user( $this->user );37 wp_set_current_user( $this->user ); 38 38 39 39 $this->bp::factory()->xprofile_field->create_many( 5, array( 'field_group_id' => $this->group_id ) ); … … 121 121 */ 122 122 public function test_get_item() { 123 $this->bp::set_current_user( $this->user );123 wp_set_current_user( $this->user ); 124 124 125 125 $field = $this->endpoint->get_xprofile_field_object( $this->field_id ); … … 179 179 */ 180 180 public function test_get_item_with_invalid_id() { 181 $this->bp::set_current_user( $this->user );181 wp_set_current_user( $this->user ); 182 182 183 183 $request = new WP_REST_Request( 'GET', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 192 192 */ 193 193 public function test_create_item() { 194 $this->bp::set_current_user( $this->user );194 wp_set_current_user( $this->user ); 195 195 196 196 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 210 210 */ 211 211 public function test_rest_create_item() { 212 $this->bp::set_current_user( $this->user );212 wp_set_current_user( $this->user ); 213 213 214 214 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 228 228 */ 229 229 public function test_create_item_with_without_required_field() { 230 $this->bp::set_current_user( $this->user );230 wp_set_current_user( $this->user ); 231 231 232 232 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 246 246 */ 247 247 public function test_create_item_with_invalid_type() { 248 $this->bp::set_current_user( $this->user );248 wp_set_current_user( $this->user ); 249 249 250 250 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 281 281 $u = static::factory()->user->create(); 282 282 283 $this->bp::set_current_user( $u );283 wp_set_current_user( $u ); 284 284 285 285 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 299 299 public function test_update_item() { 300 300 $new_name = 'Updated name'; 301 $this->bp::set_current_user( $this->user );301 wp_set_current_user( $this->user ); 302 302 303 303 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->field_id ) ); … … 331 331 */ 332 332 public function test_update_item_invalid_id() { 333 $this->bp::set_current_user( $this->user );333 wp_set_current_user( $this->user ); 334 334 335 335 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 363 363 public function test_update_item_without_permission() { 364 364 $u = static::factory()->user->create(); 365 $this->bp::set_current_user( $u );365 wp_set_current_user( $u ); 366 366 367 367 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->field_id ) ); … … 379 379 */ 380 380 public function test_delete_item() { 381 $this->bp::set_current_user( $this->user );381 wp_set_current_user( $this->user ); 382 382 383 383 $field = $this->endpoint->get_xprofile_field_object( $this->field_id ); … … 400 400 */ 401 401 public function test_delete_item_invalid_id() { 402 $this->bp::set_current_user( $this->user );402 wp_set_current_user( $this->user ); 403 403 404 404 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 425 425 public function test_delete_item_without_permission() { 426 426 $u = static::factory()->user->create(); 427 $this->bp::set_current_user( $u );427 wp_set_current_user( $u ); 428 428 429 429 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->field_id ) ); … … 438 438 */ 439 439 public function test_prepare_item() { 440 $this->bp::set_current_user( $this->user );440 wp_set_current_user( $this->user ); 441 441 442 442 $field = $this->endpoint->get_xprofile_field_object( $this->field_id ); … … 476 476 ); 477 477 478 $this->bp::set_current_user( $this->user );478 wp_set_current_user( $this->user ); 479 479 $expected = 'bar_field_value'; 480 480 … … 522 522 ); 523 523 524 $this->bp::set_current_user( $this->user );524 wp_set_current_user( $this->user ); 525 525 526 526 $expected = 'foo_field_value';
Note: See TracChangeset
for help on using the changeset viewer.