Files
FHC-Core/tests/codeception/api/DigestLogin.php
T
paolo 9aef5dcc30 HTTP basic authentication
Set this as default authentication, providing codeception test case
2016-04-15 15:41:38 +02:00

17 lines
537 B
PHP

<?php
$I = new ApiTester($scenario);
$I->wantTo('Test the HTTP digest autentication when calling an API');
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
$I->sendGET('v1/Test/test');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'success' => true,
'message' => 'API HTTP GET call test succeed']);
$I->sendPOST('v1/Test/test');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'success' => true,
'message' => 'API HTTP POST call test succeed']);