- Fixed codeception test

- Updated the api test suite
- Added the script generate.php to automatically generate the test cases
for the controllers
This commit is contained in:
bison-paolo
2016-11-23 15:09:10 +01:00
parent 68a696cdc8
commit d96a0e98d5
279 changed files with 1360 additions and 1703 deletions
@@ -0,0 +1,26 @@
<?php
$I = new ApiTester($scenario);
$I->wantTo("Test API call v1/system/Message/: MessagesByPersonID MessagesByUID MessagesByToken SentMessagesByPerson");
$I->amHttpAuthenticated("admin", "1q2w3");
$I->haveHttpHeader("FHC-API-KEY", "testapikey@fhcomplete.org");
$I->sendGET("v1/system/Message/MessagesByPersonID", array("person_id" => "1", "all" => "1"));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(["error" => 0]);
$I->wait();
$I->sendGET("v1/system/Message/MessagesByUID", array("uid" => "1", "all" => "1"));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(["error" => 0]);
$I->wait();
$I->sendGET("v1/system/Message/MessagesByToken", array("token" => "1"));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(["error" => 0]);
$I->wait();
$I->sendGET("v1/system/Message/SentMessagesByPerson", array("person_id" => "1", "all" => "1"));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(["error" => 0]);
$I->wait();