- Timestamp:
- 11/03/2024 06:19:06 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/xprofile/test-xprofile-group-controller.php
r14026 r14070 33 33 */ 34 34 public function test_get_items() { 35 $this->bp::set_current_user( $this->user );35 wp_set_current_user( $this->user ); 36 36 37 37 $this->bp::factory()->xprofile_group->create_many( 5 ); … … 72 72 */ 73 73 public function test_get_items_include_groups() { 74 $this->bp::set_current_user( $this->user );74 wp_set_current_user( $this->user ); 75 75 76 76 $g1 = $this->bp::factory()->xprofile_group->create(); … … 125 125 */ 126 126 public function test_get_item() { 127 $this->bp::set_current_user( $this->user );127 wp_set_current_user( $this->user ); 128 128 129 129 $field_group = $this->endpoint->get_xprofile_field_group_object( $this->group_id ); … … 181 181 */ 182 182 public function test_get_item_invalid_id() { 183 $this->bp::set_current_user( $this->user );183 wp_set_current_user( $this->user ); 184 184 185 185 $request = new WP_REST_Request( 'GET', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 194 194 */ 195 195 public function test_create_item() { 196 $this->bp::set_current_user( $this->user );196 wp_set_current_user( $this->user ); 197 197 198 198 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 211 211 */ 212 212 public function test_rest_create_item() { 213 $this->bp::set_current_user( $this->user );213 wp_set_current_user( $this->user ); 214 214 215 215 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 242 242 public function test_create_item_user_without_permission() { 243 243 $u = static::factory()->user->create(); 244 $this->bp::set_current_user( $u );244 wp_set_current_user( $u ); 245 245 246 246 $request = new WP_REST_Request( 'POST', $this->endpoint_url ); … … 259 259 public function test_update_item() { 260 260 $new_name = 'Updated name'; 261 $this->bp::set_current_user( $this->user );261 wp_set_current_user( $this->user ); 262 262 263 263 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->group_id ) ); … … 279 279 */ 280 280 public function test_update_item_invalid_id() { 281 $this->bp::set_current_user( $this->user );281 wp_set_current_user( $this->user ); 282 282 283 283 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 302 302 public function test_update_item_without_permission() { 303 303 $u = static::factory()->user->create(); 304 $this->bp::set_current_user( $u );304 wp_set_current_user( $u ); 305 305 306 306 $request = new WP_REST_Request( 'PUT', sprintf( $this->endpoint_url . '/%d', $this->group_id ) ); … … 314 314 */ 315 315 public function test_delete_item() { 316 $this->bp::set_current_user( $this->user );316 wp_set_current_user( $this->user ); 317 317 318 318 $field_group = $this->endpoint->get_xprofile_field_group_object( $this->group_id ); … … 335 335 */ 336 336 public function test_delete_item_invalid_id() { 337 $this->bp::set_current_user( $this->user );337 wp_set_current_user( $this->user ); 338 338 339 339 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER ) ); … … 358 358 public function test_delete_item_without_permission() { 359 359 $u = static::factory()->user->create(); 360 $this->bp::set_current_user( $u );360 wp_set_current_user( $u ); 361 361 362 362 $request = new WP_REST_Request( 'DELETE', sprintf( $this->endpoint_url . '/%d', $this->group_id ) ); … … 370 370 */ 371 371 public function test_prepare_item() { 372 $this->bp::set_current_user( $this->user );372 wp_set_current_user( $this->user ); 373 373 374 374 $group = $this->endpoint->get_xprofile_field_group_object( $this->group_id ); … … 479 479 ); 480 480 481 $this->bp::set_current_user( $this->user );481 wp_set_current_user( $this->user ); 482 482 $expected = 'bar_group_value'; 483 483 … … 525 525 ); 526 526 527 $this->bp::set_current_user( $this->user );527 wp_set_current_user( $this->user ); 528 528 $expected = 'foo_group_value'; 529 529
Note: See TracChangeset
for help on using the changeset viewer.