mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-30 02:33:14 +05:30
Ensure token works via header
This commit is contained in:
parent
cd44bf8f48
commit
ad5cef3b7d
21
tests/codecept/tests/api/GetUsersTokenHeaderCept.php
Normal file
21
tests/codecept/tests/api/GetUsersTokenHeaderCept.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
$I = new ApiGuy($scenario);
|
||||||
|
$I->wantTo('get all users with header access token');
|
||||||
|
$I->haveHttpHeader('Authorization', 'Bearer iamgod');
|
||||||
|
$I->sendGET('api.php/users');
|
||||||
|
$I->seeResponseCodeIs(200);
|
||||||
|
$I->seeResponseIsJson();
|
||||||
|
$I->seeResponseContainsJson([
|
||||||
|
[
|
||||||
|
'username' => 'alexbilbie',
|
||||||
|
'name' => 'Alex Bilbie',
|
||||||
|
'email' => 'hello@alexbilbie.com',
|
||||||
|
'photo' => 'https://s.gravatar.com/avatar/14902eb1dac66b8458ebbb481d80f0a3'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'username' => 'philsturgeon',
|
||||||
|
'name' => 'Phil Sturgeon',
|
||||||
|
'email' => 'email@philsturgeon.co.uk',
|
||||||
|
'photo' => 'https://s.gravatar.com/avatar/14df293d6c5cd6f05996dfc606a6a951'
|
||||||
|
]
|
||||||
|
]);
|
Loading…
Reference in New Issue
Block a user