mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
9aef5dcc30
Set this as default authentication, providing codeception test case
18 lines
603 B
PHP
18 lines
603 B
PHP
<?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']); |