Esempio n. 1
0
@mkdir(LOGS);
@mkdir(SESSIONS);
@mkdir(CACHE);
@mkdir(CACHE . 'views');
@mkdir(CACHE . 'models');
//@codingStandardsIgnoreEnd
require CAKE . 'Core/ClassLoader.php';
$loader = new Cake\Core\ClassLoader();
$loader->register();
$loader->addNamespace('TestApp', APP);
$loader->addNamespace('TestPlugin', TEST_APP . 'Plugin/TestPlugin');
$loader->addNamespace('TestPluginTwo', TEST_APP . 'Plugin/TestPluginTwo');
$loader->addNamespace('PluginJs', TEST_APP . 'Plugin/PluginJs');
require CAKE . 'bootstrap.php';
date_default_timezone_set('UTC');
mb_internal_encoding('UTF-8');
Configure::write('debug', true);
Configure::write('App', ['namespace' => 'App', 'encoding' => 'UTF-8', 'base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR, 'www_root' => WWW_ROOT, 'fullBaseUrl' => 'http://localhost', 'imageBaseUrl' => 'img/', 'jsBaseUrl' => 'js/', 'cssBaseUrl' => 'css/', 'paths' => ['plugins' => [TEST_APP . 'Plugin' . DS], 'templates' => [APP . 'Template' . DS]]]);
Cache::config(['_cake_core_' => ['engine' => 'File', 'prefix' => 'cake_core_', 'serialize' => true], '_cake_model_' => ['engine' => 'File', 'prefix' => 'cake_model_', 'serialize' => true]]);
// Ensure default test connection is defined
if (!getenv('db_class')) {
    putenv('db_class=Cake\\Database\\Driver\\Sqlite');
    putenv('db_dsn=sqlite::memory:');
}
ConnectionManager::config('test', ['className' => 'Cake\\Database\\Connection', 'driver' => getenv('db_class'), 'dsn' => getenv('db_dsn'), 'database' => getenv('db_database'), 'login' => getenv('db_login'), 'password' => getenv('db_password'), 'timezone' => 'UTC']);
Configure::write('Session', ['defaults' => 'php']);
Log::config(['debug' => ['engine' => 'Cake\\Log\\Engine\\FileLog', 'levels' => ['notice', 'info', 'debug'], 'file' => 'debug'], 'error' => ['engine' => 'Cake\\Log\\Engine\\FileLog', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 'file' => 'error']]);
// Initialize the empty language.
I18n::translate('empty');
Carbon\Carbon::setTestNow(Carbon\Carbon::now());