- Timestamp:
- 02/01/2023 06:36:08 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php
r54402 r55177 514 514 $this->assertSameSetsWithIndex( $data, $expected ); 515 515 } 516 517 /** 518 * @covers WP_REST_Global_Styles_Controller::get_available_actions 519 */ 520 public function test_assign_edit_css_action_admin() { 521 wp_set_current_user( self::$admin_id ); 522 523 $request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id ); 524 $request->set_param( 'context', 'edit' ); 525 $response = rest_do_request( $request ); 526 $links = $response->get_links(); 527 528 // Admins can only edit css on single site. 529 if ( is_multisite() ) { 530 $this->assertArrayNotHasKey( 'https://api.w.org/action-edit-css', $links ); 531 } else { 532 $this->assertArrayHasKey( 'https://api.w.org/action-edit-css', $links ); 533 } 534 } 516 535 }
Note: See TracChangeset
for help on using the changeset viewer.