From ad5cef3b7d6e507f02d1066aa56b978dec02eda9 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 10 May 2014 11:58:00 +0100 Subject: [PATCH] Ensure token works via header --- .../tests/api/GetUsersTokenHeaderCept.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/codecept/tests/api/GetUsersTokenHeaderCept.php diff --git a/tests/codecept/tests/api/GetUsersTokenHeaderCept.php b/tests/codecept/tests/api/GetUsersTokenHeaderCept.php new file mode 100644 index 00000000..5a8317e2 --- /dev/null +++ b/tests/codecept/tests/api/GetUsersTokenHeaderCept.php @@ -0,0 +1,21 @@ +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' + ] +]);