'TestApp', 'encoding' => 'UTF-8', 'paths' => [ 'testWebroot' => PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS, 'webroot' => PLUGIN_ROOT . DS . 'webroot' . DS, 'templates' => [ PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS, ], ], ]); Configure::write('debug', true); Configure::write('ContactUs', [ 'fields' => [ 'captcha' => false, 'email' => true, ], 'email' => [ 'mailerClass' => 'CakeContactUs.ContactUsFormSubmissions', 'confirmation' => false, // true or false 'backend' => [ // array with enabled and the to/cc/bcc/ fields as strings or arrays 'enabled' => false, 'to' => 'test@example.com', ], ], ]); Configure::write('EmailTransport', [ 'default' => [ 'className' => DebugTransport::class, ] ]); TransportFactory::setConfig('default', [ 'className' => DebugTransport::class, ]); Configure::write('Email', [ /* * Email delivery profiles * * Delivery profiles allow you to predefine various properties about email * messages from your application and give the settings a name. This saves * duplication across your application and makes maintenance and development * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email` * for more information. */ 'default' => [ 'transport' => 'default', 'from' => 'test@example.com', /* * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8. */ //'charset' => 'utf-8', //'headerCharset' => 'utf-8', ], ]); $cache = [ 'default' => [ 'engine' => 'File', 'path' => CACHE, ], '_cake_translations_' => [ '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', ], ]; Cache::setConfig($cache); Mailer::setConfig(Configure::consume('Email')); class_alias(AppController::class, 'App\Controller\AppController'); Plugin::getCollection()->add(new CakeContactUsPlugin()); Chronos::setTestNow(Chronos::now()); if (!getenv('DB_URL')) { putenv('DB_URL=sqlite:///:memory:'); } ConnectionManager::setConfig('test', [ 'className' => Connection::class, 'url' => getenv('DB_URL') ?: null, 'timezone' => 'UTC', 'quoteIdentifiers' => false, 'cacheMetadata' => true, ]); /** * Load schema from a SQL dump file. * * If your plugin does not use database fixtures you can * safely delete this. * * If you want to support multiple databases, consider * using migrations to provide schema for your plugin, * and using \Migrations\TestSuite\Migrator to load schema. */ // Load a schema dump file. //(new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); $migrator = new Migrator(); $migrator->run(['plugin' => 'CakeContactUs']);