From 1e4fc86be5b9b1171ec71416b2c2fa5e01ba9226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 16 Feb 2018 11:43:59 +0100 Subject: [PATCH] Fixed Broken Unit Tests --- .../controllers/api/v1/project/Scrumteam.php | 78 ------------------- .../models/project/Scrumteam_model.php | 14 ---- ...ite.dist.yml => acceptance.suite.yml.dist} | 0 ...{api.suite.dist.yml => api.suite.yml.dist} | 0 .../tests/api/v1/ProjectScrumteamCept.php | 11 --- .../tests/api/v1/RessourceZeitfensterCept.php | 11 --- ...ite.dist.yml => functional.suite.yml.dist} | 0 ...nit.suite.dist.yml => unit.suite.yml.dist} | 0 8 files changed, 114 deletions(-) delete mode 100644 application/controllers/api/v1/project/Scrumteam.php delete mode 100644 application/models/project/Scrumteam_model.php rename tests/codeception/tests/{acceptance.suite.dist.yml => acceptance.suite.yml.dist} (100%) rename tests/codeception/tests/{api.suite.dist.yml => api.suite.yml.dist} (100%) delete mode 100644 tests/codeception/tests/api/v1/ProjectScrumteamCept.php delete mode 100644 tests/codeception/tests/api/v1/RessourceZeitfensterCept.php rename tests/codeception/tests/{functional.suite.dist.yml => functional.suite.yml.dist} (100%) rename tests/codeception/tests/{unit.suite.dist.yml => unit.suite.yml.dist} (100%) diff --git a/application/controllers/api/v1/project/Scrumteam.php b/application/controllers/api/v1/project/Scrumteam.php deleted file mode 100644 index 5890cbbcb..000000000 --- a/application/controllers/api/v1/project/Scrumteam.php +++ /dev/null @@ -1,78 +0,0 @@ -load->model('project/scrumteam_model', 'ScrumteamModel'); - - - } - - /** - * @return void - */ - public function getScrumteam() - { - $scrumteam_kurzbz = $this->get('scrumteam_kurzbz'); - - if (isset($scrumteam_kurzbz)) - { - $result = $this->ScrumteamModel->load($scrumteam_kurzbz); - - $this->response($result, REST_Controller::HTTP_OK); - } - else - { - $this->response(); - } - } - - /** - * @return void - */ - public function postScrumteam() - { - if ($this->_validate($this->post())) - { - if (isset($this->post()['scrumteam_kurzbz'])) - { - $result = $this->ScrumteamModel->update($this->post()['scrumteam_kurzbz'], $this->post()); - } - else - { - $result = $this->ScrumteamModel->insert($this->post()); - } - - $this->response($result, REST_Controller::HTTP_OK); - } - else - { - $this->response(); - } - } - - private function _validate($scrumteam = NULL) - { - return true; - } -} \ No newline at end of file diff --git a/application/models/project/Scrumteam_model.php b/application/models/project/Scrumteam_model.php deleted file mode 100644 index 0a19c9837..000000000 --- a/application/models/project/Scrumteam_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'fue.tbl_scrumteam'; - $this->pk = 'scrumteam_kurzbz'; - } -} diff --git a/tests/codeception/tests/acceptance.suite.dist.yml b/tests/codeception/tests/acceptance.suite.yml.dist similarity index 100% rename from tests/codeception/tests/acceptance.suite.dist.yml rename to tests/codeception/tests/acceptance.suite.yml.dist diff --git a/tests/codeception/tests/api.suite.dist.yml b/tests/codeception/tests/api.suite.yml.dist similarity index 100% rename from tests/codeception/tests/api.suite.dist.yml rename to tests/codeception/tests/api.suite.yml.dist diff --git a/tests/codeception/tests/api/v1/ProjectScrumteamCept.php b/tests/codeception/tests/api/v1/ProjectScrumteamCept.php deleted file mode 100644 index 467837483..000000000 --- a/tests/codeception/tests/api/v1/ProjectScrumteamCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo("Test API call v1/project/Scrumteam/: Scrumteam"); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader("FHC-API-KEY", "testapikey@fhcomplete.org"); -$I->sendGET("v1/project/Scrumteam/Scrumteam", array("scrumteam_kurzbz" => "1")); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson(["error" => 0]); -$I->wait(); diff --git a/tests/codeception/tests/api/v1/RessourceZeitfensterCept.php b/tests/codeception/tests/api/v1/RessourceZeitfensterCept.php deleted file mode 100644 index b835a476d..000000000 --- a/tests/codeception/tests/api/v1/RessourceZeitfensterCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo("Test API call v1/ressource/Zeitfenster/: Zeitfenster"); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader("FHC-API-KEY", "testapikey@fhcomplete.org"); -$I->sendGET("v1/ressource/Zeitfenster/Zeitfenster", array("wochentag" => "1", "studiengang_kz" => "1", "ort_kurzbz" => "1", "stunde" => "1")); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson(["error" => 0]); -$I->wait(); diff --git a/tests/codeception/tests/functional.suite.dist.yml b/tests/codeception/tests/functional.suite.yml.dist similarity index 100% rename from tests/codeception/tests/functional.suite.dist.yml rename to tests/codeception/tests/functional.suite.yml.dist diff --git a/tests/codeception/tests/unit.suite.dist.yml b/tests/codeception/tests/unit.suite.yml.dist similarity index 100% rename from tests/codeception/tests/unit.suite.dist.yml rename to tests/codeception/tests/unit.suite.yml.dist