'App', 'encoding' => 'UTF-8', 'paths' => [ 'templates' => [ROOT . DS . 'tests' . DS . 'test_app' . DS . 'src' . DS . 'Template' . DS], ], ]); 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::setConfig($cache); Cake\Core\Plugin::getCollection()->add(new \Queue\Plugin()); Cake\Mailer\TransportFactory::setConfig('default', [ 'className' => 'Debug', ]); Cake\Mailer\TransportFactory::setConfig('queue', [ 'className' => 'Queue.Queue', ]); Cake\Mailer\Email::setConfig('default', [ 'transport' => 'default', ]); // Allow local overwrite // E.g. in your console: export db_dsn="mysql://root:secret@127.0.0.1/cake_test" if (!getenv('db_class') && getenv('db_dsn')) { ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]); return; } if (!getenv('db_class')) { putenv('db_class=Cake\Database\Driver\Sqlite'); putenv('db_dsn=sqlite::memory:'); } // Uses Travis config then (MySQL, Postgres, ...) ConnectionManager::setConfig('test', [ 'className' => 'Cake\Database\Connection', 'driver' => getenv('db_class'), 'dsn' => getenv('db_dsn'), 'database' => getenv('db_database'), 'username' => getenv('db_username'), 'password' => getenv('db_password'), 'timezone' => 'UTC', 'quoteIdentifiers' => true, 'cacheMetadata' => true, ]);