diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php index 82736830e..f74cb967f 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -70,6 +70,13 @@ class Orgform extends APIv1_Controller $this->response(); } } + + public function getAll() + { + $result = $this->OrgformModel->loadWhole(); + + $this->response($result, REST_Controller::HTTP_OK); + } private function _validate($orgform = NULL) { diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index a73e03bc6..e9cdaed1a 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -86,4 +86,4 @@ class Prestudentstatus extends APIv1_Controller { return true; } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json index b0dad7641..0e36d6f6f 100755 --- a/composer.json +++ b/composer.json @@ -54,7 +54,8 @@ "zetacomponents/workflow": "1.*", "zetacomponents/document": "1.*", "zetacomponents/workflow-database-tiein": "1.*", - "zetacomponents/workflow-event-log-tiein": "1.*" + "zetacomponents/workflow-event-log-tiein": "1.*", + "wikimedia/composer-merge-plugin": "^1.3" }, "require-dev": { @@ -63,5 +64,19 @@ "config": { "bin-dir": "bin" - } + }, + + "extra": { + "merge-plugin": { + "include": [ + "composer.json", + "addons/*/composer.json" + ], + "recurse": true, + "replace": false, + "merge-dev": false, + "merge-extra": false + } + } + } diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index f59f8c546..83aef920c 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -1,6 +1,8 @@ -- UPDATE tbl_studiengang UPDATE public.tbl_studiengang SET onlinebewerbung = TRUE; +-- EMPTY lehre.tbl_studienplan +DELETE FROM lehre.tbl_studienplan_semester; -- EMPTY lehre.tbl_studienplan DELETE FROM lehre.tbl_studienplan; -- EMPTY lehre.tbl_studienordnung_semester @@ -177,6 +179,10 @@ INSERT INTO lehre.tbl_studienplan VALUES (2, 1, 'VZ', 'A', '01234', 6, 'English' INSERT INTO lehre.tbl_studienplan VALUES (3, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); INSERT INTO lehre.tbl_studienplan VALUES (4, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); +-- INSERT INTO lehre.tbl_studienplan_semester (studienplan_semester_id, studienplan_id, studiensemester_kurzbz, semester) +INSERT INTO lehre.tbl_studienplan_semester VALUES (1, 1, 'WS2016', 1); + +-- DELETE FROM system.tbl_rolleberechtigung DELETE FROM system.tbl_rolleberechtigung WHERE berechtigung_kurzbz IN ( 'basis/archiv', 'basis/ausbildung', @@ -395,6 +401,7 @@ DELETE FROM system.tbl_rolleberechtigung WHERE berechtigung_kurzbz IN ( 'basis/dms_version' ); +-- DELETE FROM system.tbl_berechtigung DELETE FROM system.tbl_berechtigung WHERE berechtigung_kurzbz IN ( 'basis/archiv', 'basis/ausbildung', @@ -613,7 +620,7 @@ DELETE FROM system.tbl_berechtigung WHERE berechtigung_kurzbz IN ( 'basis/dms_version' ); --- Permissions +-- INSERT Permissions INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/archiv', 'Tbl_archiv'); INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ausbildung', 'Tbl_ausbildung'); INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/berufstaetigkeit', 'Tbl_berufstaetigkeit'); @@ -830,6 +837,7 @@ INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES(' INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienplan_semester', 'Tbl_studienplan_semester'); INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/dms_version', 'Tbl_dms_version'); +-- INSERT link between user admin and permissions INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/archiv', 'admin', 'suid'); INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ausbildung', 'admin', 'suid'); INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/berufstaetigkeit', 'admin', 'suid'); diff --git a/tests/codeception/tests/api/v1/NationCept.php b/tests/codeception/tests/api/v1/NationCept.php index c441a4249..e5b881030 100644 --- a/tests/codeception/tests/api/v1/NationCept.php +++ b/tests/codeception/tests/api/v1/NationCept.php @@ -1,9 +1,10 @@ wantTo('Test API call v1/codex/nation All and FederalState'); +$I->wantTo('Test API call v1/codex/nation/All'); $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + $I->sendGET('v1/codex/nation/All'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); diff --git a/tests/codeception/tests/api/v1/PersonCept.php b/tests/codeception/tests/api/v1/PersonCept.php index ab292bba6..4b746a4c0 100644 --- a/tests/codeception/tests/api/v1/PersonCept.php +++ b/tests/codeception/tests/api/v1/PersonCept.php @@ -1,9 +1,10 @@ wantTo('test the Person id'); +$I->wantTo('Test API call v1/person/person/person'); $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(); @@ -12,7 +13,6 @@ $I->seeResponseContainsJson([ 'nachname' => 'McKenzie']); $I->sendGET('v1/person/person/Person', array('code' => '01234567B')); -$I->wantTo('test the Person code'); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); @@ -20,7 +20,6 @@ $I->seeResponseContainsJson([ 'person_id' => '4', 'nachname' => 'Wilderman']); -$I->wantTo('test the Person not found'); $I->sendGET('v1/person/person/Person', array('code' => '12345')); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); diff --git a/tests/codeception/tests/api/v1/StudiengangCept.php b/tests/codeception/tests/api/v1/StudiengangCept.php index de1b37ae0..b2519f9d9 100644 --- a/tests/codeception/tests/api/v1/StudiengangCept.php +++ b/tests/codeception/tests/api/v1/StudiengangCept.php @@ -1,9 +1,15 @@ wantTo('Test API call v1/organisation/studiengang/AllForBewerbung'); +$I->wantTo('Test API call v1/organisation/studiengang Studiengang and AllForBewerbung'); $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/organisation/studiengang/Studiengang'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + $I->sendGET('v1/organisation/studiengang/AllForBewerbung'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); diff --git a/tests/codeception/tests/api/v1/StudienplanCept.php b/tests/codeception/tests/api/v1/StudienplanCept.php index 78a2ce600..d0abd1271 100644 --- a/tests/codeception/tests/api/v1/StudienplanCept.php +++ b/tests/codeception/tests/api/v1/StudienplanCept.php @@ -1,10 +1,43 @@ wantTo('Test API call v1/organisation/studienplan/Studienplaene'); +$I->wantTo('Test API call v1/organisation/studienplan studienplaene and studienplaeneFromSem'); $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + $I->sendGET('v1/organisation/studienplan/Studienplaene', array('studiengang_kz' => 1)); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studienplan/StudienplaeneFromSem', array('studiengang_kz' => 1, + 'studiensemester_kurzbz' => 'WS2016' + )); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studienplan/StudienplaeneFromSem', array('studiengang_kz' => 1, + 'studiensemester_kurzbz' => 'WS2016', + 'ausbildungssemester' => 1 + )); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studienplan/StudienplaeneFromSem', array('studiengang_kz' => 1, + 'studiensemester_kurzbz' => 'WS2016', + 'orgform_kurzbz' => 'VZ' + )); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studienplan/StudienplaeneFromSem', array('studiengang_kz' => 1, + 'studiensemester_kurzbz' => 'WS2016', + 'ausbildungssemester' => 1, + 'orgform_kurzbz' => 'VZ' + )); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); $I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file