@@ 33-63 (lines=31) @@ | ||
30 | /** |
|
31 | * Success grant case provider. |
|
32 | */ |
|
33 | public function grantSuccessCaseProvider() |
|
34 | { |
|
35 | return array( |
|
36 | 'default_settings' => $defaultCase = array( |
|
37 | array(), |
|
38 | AccessToken::class, |
|
39 | array( |
|
40 | array( |
|
41 | 'grant_type' => 'mocked_grant_type', |
|
42 | 'client_api_key' => 'mocked_key', |
|
43 | 'client_secret' => 'mocked_secret', |
|
44 | ), |
|
45 | array(), |
|
46 | array(), |
|
47 | ), |
|
48 | new AccessToken(new Application(), new Account(), AccessTokenInterface::DEFAULT_TTL, 'mocked_hash'), |
|
49 | ), |
|
50 | 'ttl_settings' => array_replace_recursive($defaultCase, array( |
|
51 | array('access_token_ttl' => 123456), |
|
52 | AccessToken::class, |
|
53 | array(), |
|
54 | new AccessToken(new Application(), new Account(), 123456, 'mocked_hash'), |
|
55 | )), |
|
56 | 'class_settings' => array_replace_recursive($defaultCase, array( |
|
57 | array('access_token_class' => MockedAccessToken::class), |
|
58 | MockedAccessToken::class, |
|
59 | array(), |
|
60 | new MockedAccessToken(new Application(), new Account(), AccessTokenInterface::DEFAULT_TTL, 'mocked_hash'), |
|
61 | )), |
|
62 | ); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * Test grant success cases. |
|
@@ 119-159 (lines=41) @@ | ||
116 | /** |
|
117 | * Refresh token creation cases providers. |
|
118 | */ |
|
119 | public function refreshTokenCreationCaseProvider() |
|
120 | { |
|
121 | return array( |
|
122 | 'default_settings' => $defaultCase = array( |
|
123 | array(), |
|
124 | RefreshToken::class, |
|
125 | array( |
|
126 | array( |
|
127 | 'grant_type' => 'mocked_grant_type', |
|
128 | 'client_api_key' => 'mocked_key', |
|
129 | 'client_secret' => 'mocked_secret', |
|
130 | ), |
|
131 | array(), |
|
132 | array(), |
|
133 | ), |
|
134 | new RefreshToken( |
|
135 | new Application(), |
|
136 | new Account(), |
|
137 | RefreshTokenInterface::DEFAULT_TTL, |
|
138 | 'mocked_refresh_token_hash' |
|
139 | ), |
|
140 | ), |
|
141 | 'ttl_settings' => array_replace_recursive($defaultCase, array( |
|
142 | array('refresh_token_ttl' => 654321), |
|
143 | RefreshToken::class, |
|
144 | array(), |
|
145 | new RefreshToken(new Application(), new Account(), 654321, 'mocked_refresh_token_hash'), |
|
146 | )), |
|
147 | 'class_settings' => array_replace_recursive($defaultCase, array( |
|
148 | array('refresh_token_class' => MockedRefreshToken::class), |
|
149 | MockedRefreshToken::class, |
|
150 | array(), |
|
151 | new MockedRefreshToken( |
|
152 | new Application(), |
|
153 | new Account(), |
|
154 | RefreshTokenInterface::DEFAULT_TTL, |
|
155 | 'mocked_refresh_token_hash' |
|
156 | ), |
|
157 | )), |
|
158 | ); |
|
159 | } |
|
160 | ||
161 | /** |
|
162 | * Tests refresh token creation on access token granting. |