SuiteCRM-Core/tests/unit/bootstrap.php
Dillon-Brown 7044598f34 Move all legacy handlers to backend
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:41 +01:00

41 lines
1.1 KiB
PHP

<?php
use AspectMock\Kernel;
error_reporting(E_ALL);
$kernel = Kernel::getInstance();
$kernel->init([
'appDir' => __DIR__ . '/../..',
'cacheDir' => __DIR__ . '/../../cache/test/aop',
'debug' => true,
'includePaths' => [
__DIR__ . '/../../core/backend',
__DIR__ . '/../../vendor/api-platform',
],
'excludePaths' => [
__DIR__,
__DIR__ . '/..',
],
]);
// Bootstrap composer
require_once __DIR__ . '/../../vendor/autoload.php';
chdir(__DIR__ . '/../../public/legacy');
// Bootstrap SuiteCRM
if (!defined('sugarEntry')) {
define('sugarEntry', true);
define('SUITE_PHPUNIT_RUNNER', true);
}
// Load in legacy
require_once __DIR__ . '/../../public/legacy/include/utils.php';
require_once __DIR__ . '/../../public/legacy/include/modules.php';
require_once __DIR__ . '/../../public/legacy/include/MVC/preDispatch.php';
require_once __DIR__ . '/../../public/legacy/include/entryPoint.php';
$kernel->loadFile(__DIR__ . '/../_mock/Helpers/core/legacy/Data/DBQueryResultsMocking.php');
$kernel->loadPhpFiles(__DIR__ . '/../_mock/Mock');