mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
API Calls codeception
Fixed translations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
$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->amHttpAuthenticated("wu11e001", "1Q2W3E4R");
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('Test/test');
|
||||
$I->seeResponseCodeIs(200);
|
||||
@@ -10,6 +10,7 @@ $I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => true,
|
||||
'message' => 'API HTTP GET call test succeed']);
|
||||
|
||||
$I->sendPOST('Test/test');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$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->sendGET('Test/test');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => true,
|
||||
'message' => 'API HTTP GET call test succeed']);
|
||||
$I->sendPOST('v1/Test/test');
|
||||
$I->sendPOST('Test/test');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('Test API call v1/studies/course/EnabledCourses');
|
||||
$I->amHttpAuthenticated("wu11e001", "1Q2W3E4R");
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('v1/studies/course/EnabledCourses');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Courses found']);
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('Test API call v1/nation/All');
|
||||
$I->amHttpAuthenticated("wu11e001", "1Q2W3E4R");
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('v1/nation/All');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Nation found']);
|
||||
|
||||
$I->sendGET('v1/nation/FederalState');
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Bundesland found']);
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('Test API call v1/person/person/Person by person_id');
|
||||
$I->amHttpAuthenticated("wu11e001", "1Q2W3E4R");
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('v1/person/person/Person', array('person_id' => 62788));
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Person found']);
|
||||
|
||||
$I->sendGET('v1/person/person/Person', array('code' => 'bd94ef5d5a'));
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Person found']);
|
||||
|
||||
$I->sendGET('v1/person/person/Person', array('code' => 'bd94ef5d5a', 'email' => '12351235'));
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Person found']);
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('Test API call v1/studies/plan/Plan');
|
||||
$I->amHttpAuthenticated("wu11e001", "1Q2W3E4R");
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('v1/studies/plan/Plan', array('studiengang_kz' => 257));
|
||||
$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => TRUE,
|
||||
'message' => 'Plan found']);
|
||||
Reference in New Issue
Block a user