diff --git a/lib/calendar/CalendarWriterICalendar.class.php b/lib/calendar/CalendarWriterICalendar.class.php
index b416dde82e9b86374190df17f13956f32da60a99..e65a89f98d52ebaf01c9341fb35ca4b8ebbf62ec 100644
--- a/lib/calendar/CalendarWriterICalendar.class.php
+++ b/lib/calendar/CalendarWriterICalendar.class.php
@@ -39,7 +39,8 @@ class CalendarWriterICalendar extends CalendarWriter
         if ($this->client_identifier) {
             $header .= "PRODID:" . $this->client_identifier . $this->newline;
         } else {
-            $header .= "PRODID:-//Stud.IP@{$_SERVER['SERVER_NAME']}//Stud.IP_iCalendar Library";
+            $host = $_SERVER['SERVER_NAME'] ?? parse_url($GLOBALS['ABSOLUTE_URI_STUDIP'], PHP_URL_HOST);
+            $header .= "PRODID:-//Stud.IP@{$host}//Stud.IP_iCalendar Library";
             $header .= " //EN" . $this->newline;
         }
         $header .= "METHOD:PUBLISH" . $this->newline;
diff --git a/lib/classes/I18N.php b/lib/classes/I18N.php
index 99a48b01183300bd913bcfd5e93d29c917826ff4..d34ed0b3ce7ffce2b50ab6e2e7a861356f447031 100644
--- a/lib/classes/I18N.php
+++ b/lib/classes/I18N.php
@@ -48,8 +48,9 @@ class I18N
      */
     public static function isEnabled()
     {
-        return is_array($GLOBALS['CONTENT_LANGUAGES']) &&
-            count($GLOBALS['CONTENT_LANGUAGES']) > 1;
+        return isset($GLOBALS['CONTENT_LANGUAGES'])
+            && is_array($GLOBALS['CONTENT_LANGUAGES'])
+            && count($GLOBALS['CONTENT_LANGUAGES']) > 1;
     }
 
     protected $template;
diff --git a/lib/classes/JsonApi/Middlewares/Authentication.php b/lib/classes/JsonApi/Middlewares/Authentication.php
index 5b097d677a33086ebbba4af5a1ce1e16fd1092c9..de92e15c9c06cd8fe1cf804ee8186b2fb8a2bed5 100644
--- a/lib/classes/JsonApi/Middlewares/Authentication.php
+++ b/lib/classes/JsonApi/Middlewares/Authentication.php
@@ -80,7 +80,10 @@ class Authentication
      */
     private function provideUser(Request $request, \User $user): Request
     {
-        if ('nobody' === $GLOBALS['user']->id) {
+        if (
+            !isset($GLOBALS['user'])
+            || 'nobody' === $GLOBALS['user']->id
+        ) {
             $GLOBALS['user'] = new \Seminar_User($user);
             $GLOBALS['auth'] = new \Seminar_Auth();
             $GLOBALS['auth']->auth = [
@@ -90,7 +93,9 @@ class Authentication
             ];
             $GLOBALS['perm'] = new \Seminar_Perm();
             $GLOBALS['MAIL_VALIDATE_BOX'] = false;
-            $GLOBALS['sess']->delete();
+            if (isset($GLOBALS['sess'])) {
+                $GLOBALS['sess']->delete();
+            }
             setTempLanguage($user->id);
         }
 
diff --git a/lib/classes/JsonApi/Routes/Files/FileRefsCreateByUpload.php b/lib/classes/JsonApi/Routes/Files/FileRefsCreateByUpload.php
index 8c18ca1aaaeb4bd4b41cd8054d758e4a2cc60001..9db9bd31b32ed1002cd3ea3e589ca112707a1066 100644
--- a/lib/classes/JsonApi/Routes/Files/FileRefsCreateByUpload.php
+++ b/lib/classes/JsonApi/Routes/Files/FileRefsCreateByUpload.php
@@ -22,7 +22,7 @@ class FileRefsCreateByUpload extends NonJsonApiController
             throw new AuthorizationFailedException();
         }
 
-        $term_id = $request->getParsedBody()['term-id'];
+        $term_id = $request->getParsedBody()['term-id'] ?? null;
 
         $fileRef = $this->handleUpload($request, $folder);
 
diff --git a/lib/classes/JsonApi/Routes/Forum/ForumCategoryEntriesCreate.php b/lib/classes/JsonApi/Routes/Forum/ForumCategoryEntriesCreate.php
index 86b3c8ccce0bca9edc14939c703aeb298d14c643..7199e39b100c010dcdb7bdf0c51ea0edce54dcb7 100644
--- a/lib/classes/JsonApi/Routes/Forum/ForumCategoryEntriesCreate.php
+++ b/lib/classes/JsonApi/Routes/Forum/ForumCategoryEntriesCreate.php
@@ -18,9 +18,15 @@ class ForumCategoryEntriesCreate extends AbstractEntriesCreate
     {
         $json = $this->validate($request);
         $categoryId = $args['id'];
+
+        if (!ForumCat::exists($categoryId)) {
+            throw new RecordNotFoundException('Could not find category.');
+        }
+
         $courseId = ForumCat::find($categoryId)->seminar_id;
+        $course = \Course::find($courseId);
 
-        if (!$course = \Course::find($courseId)) {
+        if (!$course) {
             throw new RecordNotFoundException('Could not find course.');
         }
 
diff --git a/lib/classes/JsonApi/Routes/Messages/InboxShow.php b/lib/classes/JsonApi/Routes/Messages/InboxShow.php
index 4d9be460c8ab35f9a2252f9bbddb48f5a6492a50..ec60b9fe9fd11f21a135d0643413b11e407142d7 100644
--- a/lib/classes/JsonApi/Routes/Messages/InboxShow.php
+++ b/lib/classes/JsonApi/Routes/Messages/InboxShow.php
@@ -15,7 +15,7 @@ class InboxShow extends BoxController
     public function __invoke(Request $request, Response $response, $args)
     {
         $filtering = $this->getQueryParameters()->getFilteringParameters();
-        $onlyUnread = (bool) $filtering['unread'];
+        $onlyUnread = !empty($filtering['unread']);
 
         return $this->getBoxResponse($request, $args, 'rec', $onlyUnread);
     }
diff --git a/lib/classes/JsonApi/settings.php b/lib/classes/JsonApi/settings.php
index dfb8185089c18c4b57407e078df5fd7ccc103284..10396b8b29b8203ecca700a354781685e938e545 100644
--- a/lib/classes/JsonApi/settings.php
+++ b/lib/classes/JsonApi/settings.php
@@ -11,8 +11,8 @@ return function (ContainerBuilder $containerBuilder) {
     // Global Settings Object
     $containerBuilder->addDefinitions([
         'studip-current-user' => function () {
-            if ($user = $GLOBALS['user']) {
-                return $user->getAuthenticatedUser();
+            if (isset($GLOBALS['user'])) {
+                return $GLOBALS['user']->getAuthenticatedUser();
             }
 
             return null;
diff --git a/lib/classes/SemClass.class.php b/lib/classes/SemClass.class.php
index 0fd486870dfe7adecf2fc22f5c3f45bafa66567d..cec05cc0ef08af34dbef42b0488a67e4cd1f6a02 100644
--- a/lib/classes/SemClass.class.php
+++ b/lib/classes/SemClass.class.php
@@ -520,7 +520,7 @@ class SemClass implements ArrayAccess
                return (bool) $this->data['is_group'];
         }
         //ansonsten
-        return $this->data[$offset];
+        return $this->data[$offset] ?? null;
     }
 
     /**
diff --git a/lib/classes/calendar/CalendarScheduleModel.php b/lib/classes/calendar/CalendarScheduleModel.php
index ce404b2335d659944bb9131a4cd632c60d719da6..4b8a63af6b3b77bb39b264c435e44ba259bd96e6 100644
--- a/lib/classes/calendar/CalendarScheduleModel.php
+++ b/lib/classes/calendar/CalendarScheduleModel.php
@@ -31,14 +31,14 @@ class CalendarScheduleModel
      */
     static function storeEntry($data)
     {
-        if ($data['id']) {     // update
+        if (!empty($data['id'])) {     // update
             $stmt = DBManager::get()->prepare("UPDATE schedule
                 SET start = ?, end = ?, day = ?, title = ?, content = ?, color = ?, user_id = ?
                 WHERE id = ?");
             $stmt->execute([$data['start'], $data['end'], $data['day'], $data['title'],
                 $data['content'], $data['color'], $data['user_id'], $data['id']]);
 
-            NotificationCenter::postNotification('ScheduleDidUpdate', $GLOBALS['user']->id, ['values' => $data]);
+            NotificationCenter::postNotification('ScheduleDidUpdate', $GLOBALS['user']->id ?? null, ['values' => $data]);
 
         } else {
             $stmt = DBManager::get()->prepare("INSERT INTO schedule
@@ -46,7 +46,7 @@ class CalendarScheduleModel
                 VALUES (?, ?, ?, ?, ?, ?, ?)");
             $stmt->execute([$data['start'], $data['end'], $data['day'], $data['title'],
                 $data['content'], $data['color'], $data['user_id']]);
-            NotificationCenter::postNotification('ScheduleDidCreate', $GLOBALS['user']->id, ['values' => $data]);
+            NotificationCenter::postNotification('ScheduleDidCreate', $GLOBALS['user']->id ?? null, ['values' => $data]);
         }
     }
 
diff --git a/lib/filesystem/StandardFile.php b/lib/filesystem/StandardFile.php
index 4f7c6164b1577d6b097a106948458334f0ef60a0..e051871e8a49cfafd0a7c3fc57dd7fd01d459e0a 100644
--- a/lib/filesystem/StandardFile.php
+++ b/lib/filesystem/StandardFile.php
@@ -36,8 +36,8 @@ class StandardFile implements FileType, ArrayAccess, StandardFileInterface
         $user_id || $user_id = $GLOBALS['user']->id;
 
         $filename   = $data['name'];
-        $mime_type  = $data['type'] ?: get_mime_type($data['name']);
-        $filesize   = $data['size'] ?: filesize($data['tmp_name']);
+        $mime_type  = $data['type'] ?? get_mime_type($data['name']);
+        $filesize   = $data['size'] ?? filesize($data['tmp_name']);
         $file_path  = $data['tmp_name'];
         $error_code = $data['error'] ?? '';
 
diff --git a/lib/messaging.inc.php b/lib/messaging.inc.php
index 2330bc6478515aeea13624cba4f8b611daefc4ea..8f2b6ce61ec4ad4ecbf9903577e74cdd89da0384 100644
--- a/lib/messaging.inc.php
+++ b/lib/messaging.inc.php
@@ -381,7 +381,7 @@ class messaging
             : 'Stud.IP-System';
         foreach ($rec_id as $one) {
             $insert->execute([$tmp_message_id, $one, $one == $snd_user_id ? 1 : 0]);
-            if ($GLOBALS['MESSAGING_FORWARD_AS_EMAIL']) {
+            if (!empty($GLOBALS['MESSAGING_FORWARD_AS_EMAIL'])) {
                 // mail to original receiver
                 $mailstatus_original = $this->user_wants_email($one);
                 if ($mailstatus_original == 2 || ($mailstatus_original == 3 && $email_request == 1) || $force_email) {
diff --git a/lib/models/CourseEvent.class.php b/lib/models/CourseEvent.class.php
index 971eca38854a657e08b127ed9dc5ce99fdfceea8..fa68b136a1007d9edd891ef0717c78da56d970fb 100644
--- a/lib/models/CourseEvent.class.php
+++ b/lib/models/CourseEvent.class.php
@@ -69,8 +69,8 @@ class CourseEvent extends CourseDate implements Event
             return null;
         };
         $config['additional_fields']['uid']['get'] = function ($date) {
-            return 'Stud.IP-SEM-' . $date->getId()
-                . '@' . $_SERVER['SERVER_NAME'];
+            $host = $_SERVER['SERVER_NAME'] ?? parse_url($GLOBALS['ABSOLUTE_URI_STUDIP'], PHP_URL_HOST);
+            return 'Stud.IP-SEM-' . $date->getId() . '@' . $host;
         };
         $config['additional_fields']['summary']['get'] = function ($date) {
             return $date->course->name;
diff --git a/lib/models/EventData.class.php b/lib/models/EventData.class.php
index 75e6f0c36ea03adb2084d5da25c041458ab2fe9c..453272d30fd7de6a29a2b46261d554145fb555cb 100644
--- a/lib/models/EventData.class.php
+++ b/lib/models/EventData.class.php
@@ -113,7 +113,7 @@ class EventData extends SimpleORMap implements PrivacyObject
     protected function cbDefaultValues()
     {
         if (empty($this->content['uid'])) {
-            $this->content['uid'] = 'Stud.IP-' . $this->event_id . '@' . $_SERVER['SERVER_NAME'];
+            $this->content['uid'] = 'Stud.IP-' . $this->event_id . '@' . ($_SERVER['SERVER_NAME'] ?? parse_url($GLOBALS['ABSOLUTE_URI_STUDIP'],  PHP_URL_HOST));
         }
     }
 
diff --git a/lib/models/File.php b/lib/models/File.php
index 097d2a31b38ec8a9cae04ad0e370115cf669ca9c..6cd0151e0a6b6a47ed0d3f29192054a828790606 100644
--- a/lib/models/File.php
+++ b/lib/models/File.php
@@ -129,7 +129,7 @@ class File extends SimpleORMap
             $this->user_id = User::findCurrent()->id;
         }
         if (!$this->author_name) {
-            $user = $this->user_id === User::findCurrent()->id
+            $user = (User::findCurrent() && $this->user_id === User::findCurrent()->id)
                   ? User::findCurrent()
                   : $this->owner;
             $this->author_name = $user ? $user->getFullName('no_title') : "";
diff --git a/lib/models/SeminarCycleDate.class.php b/lib/models/SeminarCycleDate.class.php
index 36884f04b72c648bc4d690affab68a25e34addb6..f384426895455a32e5b0fbb79972146592105304 100644
--- a/lib/models/SeminarCycleDate.class.php
+++ b/lib/models/SeminarCycleDate.class.php
@@ -612,7 +612,7 @@ class SeminarCycleDate extends SimpleORMap
                 //check for calculatable holidays
                 if ($termin instanceof CourseDate) {
                     $holy_type = SemesterHoliday::isHoliday($start_time, false);
-                    if ($holy_type["col"] == 3) {
+                    if (!is_bool($holy_type) && $holy_type['col'] == 3) {
                         $termin = new CourseExDate();
                     }
                 }
diff --git a/lib/models/User.class.php b/lib/models/User.class.php
index 434a0487956897084c0ee123540d00bc2b439ef1..7f6a402f44f1a109afab29277ed33a90d6035d2f 100644
--- a/lib/models/User.class.php
+++ b/lib/models/User.class.php
@@ -263,7 +263,7 @@ class User extends AuthUserMd5 implements Range, PrivacyObject
      */
     public static function findCurrent()
     {
-        if (is_object($GLOBALS['user'])) {
+        if (isset($GLOBALS['user']) && is_object($GLOBALS['user'])) {
             return $GLOBALS['user']->getAuthenticatedUser();
         }
 
diff --git a/tests/_support/Helper/Jsonapi.php b/tests/_support/Helper/Jsonapi.php
index 81d112c36cd765aa57081ee9ff194d4dedc6e1ed..8d98e6a55e970882bceb612c550c3d189426e84f 100644
--- a/tests/_support/Helper/Jsonapi.php
+++ b/tests/_support/Helper/Jsonapi.php
@@ -29,8 +29,8 @@ class Jsonapi extends \Codeception\Module
     public function withPHPLib($credentials, $function)
     {
         // EVIL HACK
-        $oldPerm = $GLOBALS['perm'];
-        $oldUser = $GLOBALS['user'];
+        $oldPerm = $GLOBALS['perm'] ?? null;
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['perm'] = new \Seminar_Perm();
         $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
 
diff --git a/tests/_support/_generated/JsonapiTesterActions.php b/tests/_support/_generated/JsonapiTesterActions.php
index 9faaeec96dbbe35f2edf4acde9118df8e197d724..c191a3e0c399d9e966474754c2d3f5c8bfc000ff 100644
--- a/tests/_support/_generated/JsonapiTesterActions.php
+++ b/tests/_support/_generated/JsonapiTesterActions.php
@@ -1,4 +1,4 @@
-<?php  //[STAMP] bc9d12565d6304b308d375b50b9e8556
+<?php  //[STAMP] 7e4574f977226c21c1b7dd8a4f07ec4e
 namespace _generated;
 
 // This class was automatically generated by build task
diff --git a/tests/jsonapi/BlubberCommentsByThreadIndexTest.php b/tests/jsonapi/BlubberCommentsByThreadIndexTest.php
index 30005e583f4eb0eba5b2472573445ec0db817248..a437fa0b7667767f43291b550692530bc4bfac88 100644
--- a/tests/jsonapi/BlubberCommentsByThreadIndexTest.php
+++ b/tests/jsonapi/BlubberCommentsByThreadIndexTest.php
@@ -32,7 +32,7 @@ class BlubberCommentsByThreadIndexTest extends \Codeception\Test\Unit
         $thread = $this->createPublicBlubberThreadForUser($credentials, 'Who knows Daskylos?');
 
         // Workaround old-style Stud.IP-API using $GLOBALS['user']
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
 
         $this->createBlubberComment($credentials, $thread, 'Autolykos knows him.');
diff --git a/tests/jsonapi/BlubberCommentsDeleteTest.php b/tests/jsonapi/BlubberCommentsDeleteTest.php
index 09cb84c22da45bb2e699a27376f2ff9518f48dfe..cbe4b7b07ab31ef86d10f9b38f4a3be674966cd2 100644
--- a/tests/jsonapi/BlubberCommentsDeleteTest.php
+++ b/tests/jsonapi/BlubberCommentsDeleteTest.php
@@ -32,7 +32,7 @@ class BlubberCommentsDeleteTest extends \Codeception\Test\Unit
         $thread = $this->createPublicBlubberThreadForUser($credentials2, 'Who knows Daskylos?');
 
         // Workaround old-style Stud.IP-API using $GLOBALS['user']
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = new \Seminar_User(\User::find($credentials1['id']));
 
         $num = \BlubberComment::countBySQL('1');
diff --git a/tests/jsonapi/BlubberCommentsShowTest.php b/tests/jsonapi/BlubberCommentsShowTest.php
index 832adb685d83c62a25a4a2efaabf42dc31873137..d041fae6b580d454ea82a43873216f0998c1dfd1 100644
--- a/tests/jsonapi/BlubberCommentsShowTest.php
+++ b/tests/jsonapi/BlubberCommentsShowTest.php
@@ -28,7 +28,7 @@ class BlubberCommentsShowTest extends \Codeception\Test\Unit
         $thread = $this->createPublicBlubberThreadForUser($credentials, 'Who knows Daskylos?');
 
         // Workaround old-style Stud.IP-API using $GLOBALS['user']
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
 
         $comment = $this->createBlubberComment($credentials, $thread, 'Autolykos knows him.');
diff --git a/tests/jsonapi/BlubberTestHelper.php b/tests/jsonapi/BlubberTestHelper.php
index cb43d783da9c19b1faf274f3f56820925b25da0a..e4241d4a133be264f216865f6fad9a0522858659 100644
--- a/tests/jsonapi/BlubberTestHelper.php
+++ b/tests/jsonapi/BlubberTestHelper.php
@@ -84,7 +84,7 @@ trait BlubberTestHelper
     private function createBlubberComment(array $credentials, \BlubberThread $thread, $content)
     {
         // Workaround old-style Stud.IP-API using $GLOBALS['user']
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
 
         $blubber = \BlubberComment::create(
diff --git a/tests/jsonapi/ConsultationsBlockShowTest.php b/tests/jsonapi/ConsultationsBlockShowTest.php
index 62c7ed700d9dcad5752b0228f53630a67ee453f3..4c856e9d12c1768a88c88e012e29edca77834709 100644
--- a/tests/jsonapi/ConsultationsBlockShowTest.php
+++ b/tests/jsonapi/ConsultationsBlockShowTest.php
@@ -25,7 +25,7 @@ class ConsultationsBlockShowTest extends Codeception\Test\Unit
 
         $resourceObject = $document->primaryResource();
         $this->assertTrue(is_string($resourceObject->id()));
-        $this->assertSame($block->id, $resourceObject->id());
+        $this->assertEquals($block->id, $resourceObject->id());
         $this->assertSame(Schema::TYPE, $resourceObject->type());
 
         $this->assertEquals($block->start, strtotime($resourceObject->attribute('start')));
diff --git a/tests/jsonapi/ConsultationsBookingShowTest.php b/tests/jsonapi/ConsultationsBookingShowTest.php
index 8788b77205e0b5df0d8995766a3528d99fb09574..7295c01708973b3e4ecae42158510a35b5d96a1d 100644
--- a/tests/jsonapi/ConsultationsBookingShowTest.php
+++ b/tests/jsonapi/ConsultationsBookingShowTest.php
@@ -31,7 +31,7 @@ class ConsultationsBookingShowTest extends Codeception\Test\Unit
 
         $resourceObject = $document->primaryResource();
         $this->assertTrue(is_string($resourceObject->id()));
-        $this->assertSame($booking->id, $resourceObject->id());
+        $this->assertEquals($booking->id, $resourceObject->id());
         $this->assertSame(Schema::TYPE, $resourceObject->type());
 
         $this->assertEquals(self::$BOOKING_DATA['reason'], $resourceObject->attribute('reason'));
diff --git a/tests/jsonapi/ConsultationsSlotShowTest.php b/tests/jsonapi/ConsultationsSlotShowTest.php
index be8f5b7e4273f5a839d9cc0bd038c0686d56ca0b..8219d48a0be64e03e25ab1805228aa14951a474c 100644
--- a/tests/jsonapi/ConsultationsSlotShowTest.php
+++ b/tests/jsonapi/ConsultationsSlotShowTest.php
@@ -26,7 +26,7 @@ class ConsultationsSlotShowTest extends Codeception\Test\Unit
 
         $resourceObject = $document->primaryResource();
         $this->assertTrue(is_string($resourceObject->id()));
-        $this->assertSame($slot->id, $resourceObject->id());
+        $this->assertEquals($slot->id, $resourceObject->id());
         $this->assertSame(Schema::TYPE, $resourceObject->type());
 
         $this->assertEquals($slot->start_time, strtotime($resourceObject->attribute('start_time')));
diff --git a/tests/jsonapi/FilesTestHelper.php b/tests/jsonapi/FilesTestHelper.php
index 44fd99da36690b88255283742c6cf2593417b088..3a7650e59344d6d3dbec02f93f05f5b62e8d8358 100644
--- a/tests/jsonapi/FilesTestHelper.php
+++ b/tests/jsonapi/FilesTestHelper.php
@@ -14,7 +14,7 @@ trait FilesTestHelper
         $course = \Course::find($courseId);
         $this->assertNotNull($course);
 
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = new \Seminar_User($credentials['id']);
 
         $rootFolder = Folder::createTopFolder($course->id, 'course');
diff --git a/tests/jsonapi/MessagesOutboxTest.php b/tests/jsonapi/MessagesOutboxTest.php
index 21b59cd3d13e343fdb673c7518bdafd636bf44dd..ef29f8976ce35ee73e40c3955ad14ca53f934ba8 100644
--- a/tests/jsonapi/MessagesOutboxTest.php
+++ b/tests/jsonapi/MessagesOutboxTest.php
@@ -58,7 +58,7 @@ class MessagesOutboxTest extends \Codeception\Test\Unit
     private function sendMessage(array $credentials)
     {
         // EVIL HACK
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = \User::find($credentials['id']);
 
         $message = \Message::send($credentials['id'], [$credentials['username']], 'empty subject', 'empty message');
diff --git a/tests/jsonapi/SeminarCycleDatesShowTest.php b/tests/jsonapi/SeminarCycleDatesShowTest.php
index 29535777295d57a0a9f3c20494f38f1af8cf6224..46f8b9334d623e625b75c2a94d25786dc9503b50 100644
--- a/tests/jsonapi/SeminarCycleDatesShowTest.php
+++ b/tests/jsonapi/SeminarCycleDatesShowTest.php
@@ -45,8 +45,8 @@ class SeminarCycleDatesShowTest extends \Codeception\Test\Unit
     private function createSeminarCycleDate($credentials, \Course $course)
     {
         // EVIL HACK
-        $oldUser = $GLOBALS['user'];
-        $oldAuth = $GLOBALS['auth'];
+        $oldUser = $GLOBALS['user'] ?? null;
+        $oldAuth = $GLOBALS['auth'] ?? null;
 
         $GLOBALS['user'] = new \Seminar_User(
             \User::find($credentials['id'])
diff --git a/tests/jsonapi/StructuralElementsShowTest.php b/tests/jsonapi/StructuralElementsShowTest.php
index 231a4495f4c47896bb6e663e37ad76b2443733a0..8cc168ab4b5c13a9ae8bc1c786ecdb33388d440e 100644
--- a/tests/jsonapi/StructuralElementsShowTest.php
+++ b/tests/jsonapi/StructuralElementsShowTest.php
@@ -32,7 +32,7 @@ class StructuralElementsShowTest extends \Codeception\Test\Unit
         $this->assertTrue($response->isSuccessfulDocument([200]));
 
         $document = $response->document();
-        $this->assertSame($structuralElement->id, $document->primaryResource()->id());
+        $this->assertEquals($structuralElement->id, $document->primaryResource()->id());
         $this->assertFalse($document->hasAnyIncludedResources());
     }
 
@@ -45,7 +45,7 @@ class StructuralElementsShowTest extends \Codeception\Test\Unit
         $this->assertTrue($response->isSuccessfulDocument([200]));
 
         $document = $response->document();
-        $this->assertSame($structuralElement->id, $document->primaryResource()->id());
+        $this->assertEquals($structuralElement->id, $document->primaryResource()->id());
         $this->assertTrue($document->hasAnyIncludedResources());
 
         $includedResources = $document->includedResources();
diff --git a/tests/jsonapi/StudipPropertiesIndexTest.php b/tests/jsonapi/StudipPropertiesIndexTest.php
index 2f83cb4579f7792d8da2f90b2ac86cecefa1dddf..bf44755d7f84bbc8e1abc6af5568786aa70c00b8 100644
--- a/tests/jsonapi/StudipPropertiesIndexTest.php
+++ b/tests/jsonapi/StudipPropertiesIndexTest.php
@@ -11,6 +11,10 @@ class StudipPropertiesIndexTest extends \Codeception\Test\Unit
 
     protected function _before()
     {
+        if (!isset($GLOBALS['SOFTWARE_VERSION'])) {
+            $GLOBALS['SOFTWARE_VERSION'] = '';
+        }
+
         \DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
     }
 
diff --git a/tests/jsonapi/UserEventsIcalTest.php b/tests/jsonapi/UserEventsIcalTest.php
index 3d0a78a31c17405f938e4608b285ac4b055b286f..81230d457c65d13c44f6ccb6c5fd2ab55f7ebe4f 100644
--- a/tests/jsonapi/UserEventsIcalTest.php
+++ b/tests/jsonapi/UserEventsIcalTest.php
@@ -27,7 +27,7 @@ class UserEventsIcalTest extends \Codeception\Test\Unit
         $event = $calendar->getNewEvent();
         $event->setTitle('blypyp');
 
-        $oldUser = $GLOBALS['user'];
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['user'] = \User::find($credentials['id']);
 
         $calendar->storeEvent($event, [$credentials['id']]);
diff --git a/tests/jsonapi/WikiIndexTest.php b/tests/jsonapi/WikiIndexTest.php
index 1113672ef049e734de6933cea05a6740df9a2acd..8fd8e96bf755125e2c40711e05386a94c68d57d6 100644
--- a/tests/jsonapi/WikiIndexTest.php
+++ b/tests/jsonapi/WikiIndexTest.php
@@ -66,8 +66,8 @@ class WikiIndexTest extends \Codeception\Test\Unit
     private function createWikiPage($userId, $courseId, $keyword, $body)
     {
         // EVIL HACK
-        $oldPerm = $GLOBALS['perm'];
-        $oldUser = $GLOBALS['user'];
+        $oldPerm = $GLOBALS['perm'] ?? null;
+        $oldUser = $GLOBALS['user'] ?? null;
         $GLOBALS['perm'] = new \Seminar_Perm();
         $GLOBALS['user'] = \User::find($userId);
 
@@ -77,7 +77,7 @@ class WikiIndexTest extends \Codeception\Test\Unit
                 'user_id' => $userId,
                 'range_id' => $courseId,
                 'keyword' => $keyword,
-                'version' => $latest->version + 1,
+                'version' => $latest ? $latest->version + 1 : 1,
                 'body' => $body
             ]
         );
diff --git a/tests/jsonapi/_bootstrap.php b/tests/jsonapi/_bootstrap.php
index a6177dff77c56df0bb30402104024a95b8c082bc..61325efc82c9cbb0e0bb06a4024c2bf7b05e1c25 100644
--- a/tests/jsonapi/_bootstrap.php
+++ b/tests/jsonapi/_bootstrap.php
@@ -2,7 +2,7 @@
 
 // Here you can initialize variables that will be available to your tests
 
-global $STUDIP_BASE_PATH, $ABSOLUTE_URI_STUDIP, $CACHING_ENABLE, $CACHING_FILECACHE_PATH, $SYMBOL_SHORT, $TMP_PATH, $UPLOAD_PATH;
+global $STUDIP_BASE_PATH, $ABSOLUTE_URI_STUDIP, $CACHING_ENABLE, $CACHING_FILECACHE_PATH, $SYMBOL_SHORT, $TMP_PATH, $UPLOAD_PATH, $DYNAMIC_CONTENT_PATH, $DYNAMIC_CONTENT_URL;
 
 // common set-up, usually done by lib/bootstraph.php and
 // config/config_local.inc.php when run on web server
@@ -11,6 +11,8 @@ if (!isset($STUDIP_BASE_PATH)) {
     $ABSOLUTE_PATH_STUDIP = $STUDIP_BASE_PATH.'/public/';
     $UPLOAD_PATH = $STUDIP_BASE_PATH.'/data/upload_doc';
     $TMP_PATH = $TMP_PATH ?: '/tmp';
+    $DYNAMIC_CONTENT_PATH = '';
+    $DYNAMIC_CONTENT_URL = '';
 }
 
 // set include path