diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php index f74cb967f..be3b058de 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -71,7 +71,7 @@ class Orgform extends APIv1_Controller } } - public function getAll() + public function getAll() { $result = $this->OrgformModel->loadWhole(); diff --git a/include/kontakt.class.php b/include/kontakt.class.php index 402009af0..d5a46b3eb 100644 --- a/include/kontakt.class.php +++ b/include/kontakt.class.php @@ -23,9 +23,13 @@ * Klasse kontakt * @create 20-12-2006 */ -require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/datum.class.php'); -class kontakt extends basis_db +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/person/Kontakt_model.php'); + +class kontakt extends Kontakt_model { public $new; // boolean public $result = array(); // adresse Objekt diff --git a/include/nation.class.php b/include/nation.class.php index 816f0fbbe..e925457ce 100644 --- a/include/nation.class.php +++ b/include/nation.class.php @@ -28,7 +28,7 @@ require_once(dirname(__FILE__).'/datum.class.php'); // CI require_once(dirname(__FILE__).'/../ci_hack.php'); -require_once(dirname(__FILE__).'/../application/models/Nation_model.php'); +require_once(dirname(__FILE__).'/../application/models/codex/Nation_model.php'); class nation extends Nation_model { diff --git a/include/organisationsform.class.php b/include/organisationsform.class.php index b4ee3ebe4..b568aefe0 100644 --- a/include/organisationsform.class.php +++ b/include/organisationsform.class.php @@ -23,8 +23,14 @@ /** * Klasse Organisationsform */ + +require_once(dirname(__FILE__).'/datum.class.php'); + +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/codex/Orgform_model.php'); -class organisationsform extends basis_db +class organisationsform extends Orgform_model { public $orgform_kurzbz; public $code; diff --git a/include/preinteressent.class.php b/include/preinteressent.class.php index 82705a9cb..2326e4580 100644 --- a/include/preinteressent.class.php +++ b/include/preinteressent.class.php @@ -19,10 +19,13 @@ * Andreas Oesterreicher and * Rudolf Hangl . */ -require_once(dirname(__FILE__).'/basis_db.class.php'); require_once(dirname(__FILE__).'/datum.class.php'); -class preinteressent extends basis_db +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/crm/Preinteressent_model.php'); + +class preinteressent extends Preinteressent_model { public $new; // boolean public $result = array(); diff --git a/include/prestudent.class.php b/include/prestudent.class.php index d02e459f9..0b9fa2099 100755 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -25,9 +25,9 @@ require_once(dirname(__FILE__).'/datum.class.php'); // CI require_once(dirname(__FILE__).'/../ci_hack.php'); -require_once(dirname(__FILE__).'/../application/models/person/Person_model.php'); +require_once(dirname(__FILE__).'/../application/models/crm/Prestudent_model.php'); -class prestudent extends Person_model +class prestudent extends Prestudent_model { use db_extra; //CI Hack public $errormsg; // string diff --git a/include/studienplan.class.php b/include/studienplan.class.php index 157a9d3c6..e24a3e6d2 100644 --- a/include/studienplan.class.php +++ b/include/studienplan.class.php @@ -29,7 +29,7 @@ require_once(dirname(__FILE__).'/datum.class.php'); // CI require_once(dirname(__FILE__).'/../ci_hack.php'); -require_once(dirname(__FILE__).'/../application/models/lehre/Studienplan_model.php'); +require_once(dirname(__FILE__).'/../application/models/organisation/Studienplan_model.php'); class studienplan extends Studienplan_model { diff --git a/include/studiensemester.class.php b/include/studiensemester.class.php index 6b90bc586..325888189 100644 --- a/include/studiensemester.class.php +++ b/include/studiensemester.class.php @@ -20,9 +20,13 @@ * Rudolf Hangl and * Gerald Simane-Sequens */ -require_once('basis_db.class.php'); +require_once(dirname(__FILE__).'/datum.class.php'); -class studiensemester extends basis_db +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/organisation/Studiensemester_model.php'); + +class studiensemester extends Studiensemester_model { public $new; // boolean public $studiensemester = array(); // studiensemester Objekt diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index 83aef920c..bf016d0ae 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -1,6 +1,12 @@ -- UPDATE tbl_studiengang UPDATE public.tbl_studiengang SET onlinebewerbung = TRUE; +-- EMPTY public.tbl_preinteressent +DELETE FROM public.tbl_preinteressent; +-- EMPTY public.tbl_prestudentstatus +DELETE FROM public.tbl_prestudentstatus; +-- EMPTY public.tbl_prestudent +DELETE FROM public.tbl_prestudent; -- EMPTY lehre.tbl_studienplan DELETE FROM lehre.tbl_studienplan_semester; -- EMPTY lehre.tbl_studienplan @@ -179,6 +185,15 @@ 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 Prestudent (public.tbl_prestudent) +INSERT INTO public.tbl_prestudent VALUES (1, 'TGM', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'f', NULL, 't', NULL, NULL, NULL, NULL, NULL, NULL, 'f', NULL, NULL, NULL, 0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +-- INSERT Prestudent status (public.tbl_prestudentstatus) +INSERT INTO public.tbl_prestudentstatus VALUES (1, 'Interessent', 'WS2016', 1, NOW(), NOW(), 'codeception', NOW(), 'codeception', NULL, 'VZ', 1, NULL, 'admin', NULL, NULL, NULL, NULL); + +-- INSERT Preinteressent (public.tbl_preinteressent) +INSERT INTO public.tbl_preinteressent VALUES (1, 1, 'WS2016', 'TGM', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'bewerbungonline', 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); diff --git a/tests/codeception/tests/api/v1/BundeslandCept.php b/tests/codeception/tests/api/v1/BundeslandCept.php new file mode 100644 index 000000000..6da71635b --- /dev/null +++ b/tests/codeception/tests/api/v1/BundeslandCept.php @@ -0,0 +1,11 @@ +wantTo('Test API call v1/codex/bundesland/All'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/codex/bundesland/All'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/DmsCept.php b/tests/codeception/tests/api/v1/DmsCept.php new file mode 100644 index 000000000..fae3894b9 --- /dev/null +++ b/tests/codeception/tests/api/v1/DmsCept.php @@ -0,0 +1,11 @@ +wantTo('Test API call v1/content/dms/dms'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/content/dms/Dms', array('dms_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/KontactCept.php b/tests/codeception/tests/api/v1/KontactCept.php new file mode 100644 index 000000000..99e466ae4 --- /dev/null +++ b/tests/codeception/tests/api/v1/KontactCept.php @@ -0,0 +1,11 @@ +wantTo('Test API call v1/person/kontakt/kontakt'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/person/kontakt/kontakt', array('person_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/OrgformCept.php b/tests/codeception/tests/api/v1/OrgformCept.php new file mode 100644 index 000000000..70cb5963e --- /dev/null +++ b/tests/codeception/tests/api/v1/OrgformCept.php @@ -0,0 +1,16 @@ +wantTo('Test API call v1/codex/orgform Orgform and All'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/codex/orgform/Orgform', array('orgform_kurzbz' => 'VZ')); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/codex/orgform/All'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/PreinteressentCept.php b/tests/codeception/tests/api/v1/PreinteressentCept.php new file mode 100644 index 000000000..3149da7ee --- /dev/null +++ b/tests/codeception/tests/api/v1/PreinteressentCept.php @@ -0,0 +1,16 @@ +wantTo('Test API call v1/crm/preinteressent Preinteressent and PreinteressentByPersonID'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/crm/preinteressent/Preinteressent', array('preinteressent_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/crm/preinteressent/PreinteressentByPersonID', array('person_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/PrestudentCept.php b/tests/codeception/tests/api/v1/PrestudentCept.php new file mode 100644 index 000000000..1d718d33b --- /dev/null +++ b/tests/codeception/tests/api/v1/PrestudentCept.php @@ -0,0 +1,16 @@ +wantTo('Test API call v1/crm/prestudent Prestudent and PrestudentByPersonID'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/crm/prestudent/Prestudent', array('prestudent_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/crm/prestudent/PrestudentByPersonID', array('person_id' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/StudiengangCept.php b/tests/codeception/tests/api/v1/StudiengangCept.php index b2519f9d9..f6e100bf1 100644 --- a/tests/codeception/tests/api/v1/StudiengangCept.php +++ b/tests/codeception/tests/api/v1/StudiengangCept.php @@ -5,7 +5,7 @@ $I->wantTo('Test API call v1/organisation/studiengang Studiengang and AllForBewe $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/organisation/studiengang/Studiengang'); +$I->sendGET('v1/organisation/studiengang/Studiengang', array('studiengang_kz' => 1)); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); $I->seeResponseContainsJson(['error' => 0]); diff --git a/tests/codeception/tests/api/v1/StudiensemesterCept.php b/tests/codeception/tests/api/v1/StudiensemesterCept.php new file mode 100644 index 000000000..36e266786 --- /dev/null +++ b/tests/codeception/tests/api/v1/StudiensemesterCept.php @@ -0,0 +1,21 @@ +wantTo('Test API call v1/organisation/studiensemester studiensemester and nextStudiensemester'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); + +$I->sendGET('v1/organisation/studiensemester/Studiensemester', array('studiensemester_kurzbz' => 'WS2016')); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studiensemester/NextStudiensemester'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); + +$I->sendGET('v1/organisation/studiensemester/NextStudiensemester', array('art' => 'WS')); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file