aboutsummaryrefslogtreecommitdiff
path: root/tests/jsonapi
diff options
context:
space:
mode:
authorMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2023-06-13 06:18:55 +0000
committerMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2023-06-13 06:18:55 +0000
commit86504cf65b83145bffb9c2bfc487373049b76722 (patch)
treed8e6b4be1213cd5a12a8169f2f5b7c57c18a5d74 /tests/jsonapi
parentb2bbd2919fd458184f681a26bf56c15cc823c343 (diff)
Refactor Blubber using vue, closes #1695
Closes #1695 Merge request studip/studip!1791
Diffstat (limited to 'tests/jsonapi')
-rw-r--r--tests/jsonapi/BlubberThreadsCreateTest.php6
-rw-r--r--tests/jsonapi/BlubberThreadsIndexTest.php6
-rw-r--r--tests/jsonapi/BlubberThreadsShowTest.php6
-rw-r--r--tests/jsonapi/_bootstrap.php3
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/jsonapi/BlubberThreadsCreateTest.php b/tests/jsonapi/BlubberThreadsCreateTest.php
index 4b275d5..17846f8 100644
--- a/tests/jsonapi/BlubberThreadsCreateTest.php
+++ b/tests/jsonapi/BlubberThreadsCreateTest.php
@@ -18,6 +18,12 @@ class BlubberThreadsCreateTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+
+ // Create global template factory if neccessary
+ $has_template_factory = isset($GLOBALS['template_factory']);
+ if (!$has_template_factory) {
+ $GLOBALS['template_factory'] = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/templates');
+ }
}
protected function _after()
diff --git a/tests/jsonapi/BlubberThreadsIndexTest.php b/tests/jsonapi/BlubberThreadsIndexTest.php
index ea665ab..ec2929c 100644
--- a/tests/jsonapi/BlubberThreadsIndexTest.php
+++ b/tests/jsonapi/BlubberThreadsIndexTest.php
@@ -17,6 +17,12 @@ class BlubberThreadsIndexTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+
+ // Create global template factory if neccessary
+ $has_template_factory = isset($GLOBALS['template_factory']);
+ if (!$has_template_factory) {
+ $GLOBALS['template_factory'] = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/templates');
+ }
}
protected function _after()
diff --git a/tests/jsonapi/BlubberThreadsShowTest.php b/tests/jsonapi/BlubberThreadsShowTest.php
index 856865d..910338d 100644
--- a/tests/jsonapi/BlubberThreadsShowTest.php
+++ b/tests/jsonapi/BlubberThreadsShowTest.php
@@ -14,6 +14,12 @@ class BlubberThreadsShowTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+
+ // Create global template factory if neccessary
+ $has_template_factory = isset($GLOBALS['template_factory']);
+ if (!$has_template_factory) {
+ $GLOBALS['template_factory'] = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/templates');
+ }
}
protected function _after()
diff --git a/tests/jsonapi/_bootstrap.php b/tests/jsonapi/_bootstrap.php
index d9c5adc..a6177df 100644
--- a/tests/jsonapi/_bootstrap.php
+++ b/tests/jsonapi/_bootstrap.php
@@ -51,6 +51,7 @@ StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/plugins/eng
StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/calendar');
StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/calendar', 'Studip\\Calendar');
StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/calendar/lib');
+StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/exceptions');
StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/filesystem');
StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'].'/lib/migrations');
@@ -98,3 +99,5 @@ class DB_Seminar extends DB_Sql
}
require_once __DIR__.'/../../composer/autoload.php';
+
+session_id("test-session");