Files
FHC-Core/tests/codeception/tests/api/v1/PersonCept.php
T
paolo 0dc605df3c - Modified FHC_Model, now it is saving uid in CI session
- Added codeception tests
- Added statistik to dump.sql
- Moved old libraries to CI
2016-06-06 16:36:23 +02:00

40 lines
1.3 KiB
PHP

<?php
$I = new ApiTester($scenario);
$I->wantTo('Test API call v1/person/person/ Person and CheckBewerbung');
$I->amHttpAuthenticated("admin", "1q2w3");
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
$I->sendGET('v1/person/person/Person', array('person_id' => 3));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'person_id' => '3',
'nachname' => 'McKenzie']);
$I->sendGET('v1/person/person/Person', array('code' => '01234567B'));
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'person_id' => '4',
'nachname' => 'Wilderman']);
$I->sendGET('v1/person/person/Person', array('code' => '12345'));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'error' => 0,
'retval' => array()]);
$I->sendGET('v1/person/person/Person', array('code' => '01234567C', 'email' => 'harvey.joshuah@calva.dev'));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson([
'person_id' => '5',
'nachname' => 'Harvey']);
$I->sendGET('v1/person/person/CheckBewerbung', array('email' => 'mckenzie.vicenta@calva.dev', 'studiensemester_kurzbz' => 'WS2016'));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(['error' => 0]);