- Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy path_bootstrap.php
More file actions
36 lines (28 loc) · 1.19 KB
/
_bootstrap.php
File metadata and controls
36 lines (28 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
/*
* This is the initial test bootstrap, which will load the default test bootstrap from the humhub core
*/
$testRoot = dirname(__DIR__);
\Codeception\Configuration::append(['test_root' => $testRoot]);
codecept_debug('Module root: ' . $testRoot);
$humhubPath = getenv('HUMHUB_PATH');
if ($humhubPath === false) {
// If no environment path was set, we assume residing in default the modules directory
$moduleConfig = require $testRoot . '/config/test.php';
if (isset($moduleConfig['humhub_root'])) {
$humhubPath = $moduleConfig['humhub_root'];
} else {
$humhubPath = dirname(__DIR__, 5);
}
}
\Codeception\Configuration::append(['humhub_root' => $humhubPath]);
codecept_debug('HumHub Root: ' . $humhubPath);
// Load test configuration (/config/test.php or /config/env/<environment>/test.php
$globalConfig = require $humhubPath . '/protected/humhub/tests/codeception/_loadConfig.php';
// Load default test bootstrap (initialize Yii...)
require $globalConfig['humhub_root'] . '/protected/humhub/tests/codeception/_bootstrap.php';