Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5980614
AccessTokenEndpointTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
AccessTokenEndpointTest.php
View Options
<?php
namespace
MediaWiki\Extension\OAuth\Tests\Rest
;
use
MediaWiki\Extension\OAuth\Rest\Handler\AccessToken
;
use
MediaWiki\Rest\Handler
;
/**
* @covers \MediaWiki\Extension\OAuth\Rest\Handler\AccessToken
* @group OAuth
* @group Database
*/
class
AccessTokenEndpointTest
extends
EndpointTestBase
{
public
static
function
provideTestHandlerExecute
()
{
return
[
'normal'
=>
[
[
'method'
=>
'POST'
,
'uri'
=>
self
::
makeUri
(
'/oauth2/access_token'
),
'headers'
=>
[
'Content-Type'
=>
'application/x-www-form-urlencoded'
],
'postParams'
=>
[
'grant_type'
=>
'authorization_code'
,
'client_id'
=>
'dummy'
]
],
[
'statusCode'
=>
401
,
'reasonPhrase'
=>
'Unauthorized'
,
'protocolVersion'
=>
'1.1'
]
],
'invalid grant type'
=>
[
[
'method'
=>
'POST'
,
'uri'
=>
self
::
makeUri
(
'/oauth2/access_token'
),
'postParams'
=>
[
'grant_type'
=>
'dummy'
,
'client_id'
=>
'dummy'
]
],
[
'statusCode'
=>
400
,
'reasonPhrase'
=>
'Bad Request'
,
'protocolVersion'
=>
'1.1'
]
],
'grant type missing'
=>
[
[
'method'
=>
'POST'
,
'uri'
=>
self
::
makeUri
(
'/oauth2/access_token'
),
'postParams'
=>
[
'client_id'
=>
'dummy'
]
],
[
'statusCode'
=>
400
,
'reasonPhrase'
=>
'Bad Request'
,
'protocolVersion'
=>
'1.1'
]
],
];
}
protected
function
newHandler
():
Handler
{
return
AccessToken
::
factory
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 21:28 (1 w, 23 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
94/29/6ea71a455d2a15d3da7236b35792
Default Alt Text
AccessTokenEndpointTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment