HTTP basic authentication

Set this as default authentication, providing codeception test case
This commit is contained in:
paolo
2016-04-15 15:41:38 +02:00
parent aec2e7b5ac
commit 9aef5dcc30
12 changed files with 4329 additions and 75 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
$I = new ApiTester($scenario);
$I->wantTo('Test the HTTP basic autentication whith HTTP GET and POST method and the API Keys');
$I->amHttpAuthenticated("aufname", "1q2w3");
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
$I->sendGET('Test/test');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'success' => true,
'message' => 'API HTTP GET call test succeed']);
$I->sendPOST('Test/test');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'success' => true,
'message' => 'API HTTP POST call test succeed']);