示例#1
0
define('APP', sys_get_temp_dir());
define('APP_DIR', 'src');
define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp');
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
define('CAKE', CORE_PATH . APP_DIR . DS);
define('WWW_ROOT', ROOT . DS . 'webroot' . DS);
define('CONFIG', dirname(__FILE__) . DS . 'config' . DS);
ini_set('intl.default_locale', 'de-DE');
require ROOT . '/vendor/autoload.php';
require CORE_PATH . 'config/bootstrap.php';
Cake\Core\Configure::write('App', ['namespace' => 'App', 'encoding' => 'UTF-8']);
Cake\Core\Configure::write('debug', true);
Cake\Core\Configure::write('EmailTransport', ['default' => ['className' => 'Debug']]);
Cake\Core\Configure::write('Email', ['default' => ['transport' => 'default', 'from' => 'you@localhost']]);
mb_internal_encoding('UTF-8');
$Tmp = new \Cake\Filesystem\Folder(TMP);
$Tmp->create(TMP . 'cache/models', 0770);
$Tmp->create(TMP . 'cache/persistent', 0770);
$Tmp->create(TMP . 'cache/views', 0770);
$cache = ['default' => ['engine' => 'File', 'path' => CACHE], '_cake_core_' => ['className' => 'File', 'prefix' => 'crud_myapp_cake_core_', 'path' => CACHE . 'persistent/', 'serialize' => true, 'duration' => '+10 seconds'], '_cake_model_' => ['className' => 'File', 'prefix' => 'crud_my_app_cake_model_', 'path' => CACHE . 'models/', 'serialize' => 'File', 'duration' => '+10 seconds']];
Cake\Cache\Cache::config($cache);
Cake\Core\Plugin::load('Queue', ['path' => ROOT . DS]);
Cake\Core\Plugin::load('Tools', ['path' => ROOT . DS . 'plugins' . DS . 'Tools' . DS]);
Cake\Network\Email\Email::configTransport('default', ['className' => 'Debug']);
Cake\Network\Email\Email::configTransport('queue', ['className' => 'Queue.Queue']);
Cake\Network\Email\Email::config('default', ['transport' => 'default']);
// Ensure default test connection is defined
if (!getenv('db_class')) {
    putenv('db_class=Cake\\Database\\Driver\\Sqlite');
    putenv('db_dsn=sqlite::memory:');
}
_define('APP_DIR', 'App');
_define('WEBROOT_DIR', 'webroot');
_define('APP', ROOT . '/tests/App/');
_define('CONFIG', ROOT . '/tests/Config/');
_define('WWW_ROOT', ROOT . DS . WEBROOT_DIR . DS);
_define('TESTS', ROOT . DS . 'tests' . DS);
_define('TMP', ROOT . DS . 'tmp' . DS);
_define('LOGS', TMP . 'logs' . DS);
_define('CACHE', TMP . 'cache' . DS);
_define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp');
_define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
_define('CAKE', CORE_PATH . 'src' . DS);
//require_once ROOT . '/vendor/cakephp/cakephp/src/basics.php';
require_once ROOT . '/vendor/autoload.php';
Cake\Core\Configure::write('App', ['namespace' => 'CakeDC\\OracleDriver\\Test\\App']);
Cake\Core\Configure::write('debug', true);
$TMP = new \Cake\Filesystem\Folder(TMP);
$TMP->create(TMP . 'cache/models', 0777);
$TMP->create(TMP . 'cache/persistent', 0777);
$TMP->create(TMP . 'cache/views', 0777);
$cache = ['default' => ['engine' => 'File'], '_cake_core_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_core_', 'path' => CACHE . 'persistent/', 'serialize' => true, 'duration' => '+10 seconds'], '_cake_model_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_model_', 'path' => CACHE . 'models/', 'serialize' => 'File', 'duration' => '+10 seconds'], '_cake_method_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_method_', 'path' => CACHE . 'models/', 'serialize' => 'File', 'duration' => '+10 seconds']];
Cake\Cache\Cache::config($cache);
Cake\Core\Configure::write('Session', ['defaults' => 'php']);
Cake\Core\Plugin::load('CakeDC\\OracleDriver', ['path' => ROOT . DS, 'autoload' => true]);
Cake\Routing\DispatcherFactory::add('Routing');
Cake\Routing\DispatcherFactory::add('ControllerFactory');
// Ensure default test connection is defined
if (!getenv('db_dsn')) {
    putenv('db_dsn=sqlite:///:memory:');
}
Cake\Datasource\ConnectionManager::config('test', ['url' => getenv('db_dsn'), 'timezone' => 'UTC']);