mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
- Added codeception test cases
- Moved old libraries to CI
This commit is contained in:
@@ -71,7 +71,7 @@ class Orgform extends APIv1_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
public function getAll()
|
||||
{
|
||||
$result = $this->OrgformModel->loadWhole();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -19,10 +19,13 @@
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -20,9 +20,13 @@
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
@@ -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]);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->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]);
|
||||
Reference in New Issue
Block a user