humhub/index-test.php

37 lines
1.3 KiB
PHP
Raw Normal View History

2015-07-11 08:42:58 +02:00
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
// NOTE: Make sure this file is not accessible when deployed to production
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
die('You are not allowed to access this file.');
}
if (isset($_SERVER['REQUEST_URI']) && preg_match('/\.(?:css|json|js|png|jpg|jpeg|gif|ttf|woff|woff2)(\?.+)?$/i', $_SERVER['REQUEST_URI'])) {
return false; // serve the requested resource as-is.
}
/*defined('YII_DEBUG') or define('YII_DEBUG', true);*/
2015-07-11 08:42:58 +02:00
defined('YII_ENV') or define('YII_ENV', 'test');
2016-07-14 23:32:49 +02:00
defined('YII_ENV_TEST') or define('YII_ENV_TEST', true);
2015-07-11 08:42:58 +02:00
require(__DIR__ . '/protected/vendor/autoload.php');
require(__DIR__ . '/protected/vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge(
// add more configurations here
(is_readable(__DIR__ . '/protected/humhub/tests/codeception/config/dynamic.php')) ? require(__DIR__ . '/protected/humhub/tests/codeception/config/dynamic.php') : [],
2016-07-14 23:32:49 +02:00
require(__DIR__ . '/protected/humhub/tests/codeception/config/acceptance.php')
);
2015-07-11 08:42:58 +02:00
require_once './protected/vendor/codeception/codeception/autoload.php';
include './protected/humhub/tests/c3.php';
2015-07-11 08:42:58 +02:00
(new humhub\components\Application($config))->run();