REST API: Correctly test the roles parameter when creating a user in WP_Test_REST_Users_Controller
.
Props jnylen0. Fixes #38575. git-svn-id: https://develop.svn.wordpress.org/trunk@39043 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
67044fe410
commit
b5a4df509e
@ -661,7 +661,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
'name' => 'Test User',
|
||||
'nickname' => 'testuser',
|
||||
'slug' => 'test-user',
|
||||
'role' => 'editor',
|
||||
'roles' => array( 'editor' ),
|
||||
'description' => 'New API User',
|
||||
'url' => 'http://example.com',
|
||||
);
|
||||
@ -673,6 +673,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
$response = $this->server->dispatch( $request );
|
||||
$data = $response->get_data();
|
||||
$this->assertEquals( 'http://example.com', $data['url'] );
|
||||
$this->assertEquals( array( 'editor' ), $data['roles'] );
|
||||
$this->check_add_edit_user_response( $response );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user