forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathincludesUser.php
More file actions
58 lines (54 loc) · 1.32 KB
/
includesUser.php
File metadata and controls
58 lines (54 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @group admin
* @group user
*/
class Tests_Admin_IncludesUser extends WP_UnitTestCase {
/**
* @ticket 42790
* @dataProvider data_is_authorize_application_password_request_valid
* @param array $request The request data to validate.
* @param string $error_code The expected error code, empty if no error.
*/
public function test_is_authorize_application_password_request_valid( $request, $error_code ) {
$error = wp_is_authorize_application_password_request_valid( $request, get_userdata( 1 ) );
if ( $error_code ) {
$this->assertWPError( $error );
$this->assertEquals( $error_code, $error->get_error_code() );
} else {
$this->assertNotWPError( $error );
}
}
public function data_is_authorize_application_password_request_valid() {
return array(
array(
array(),
'',
),
array(
array( 'success_url' => 'http://example.org' ),
'invalid_redirect_scheme',
),
array(
array( 'reject_url' => 'http://example.org' ),
'invalid_redirect_scheme',
),
array(
array( 'success_url' => 'https://example.org' ),
'',
),
array(
array( 'reject_url' => 'https://example.org' ),
'',
),
array(
array( 'success_url' => 'wordpress://example' ),
'',
),
array(
array( 'reject_url' => 'wordpress://example' ),
'',
),
);
}
}