'Cake\Database\Connection', 'driver' => 'Cake\Database\Driver\Sqlite', 'database' => TMP . 'debug_kit.sqlite', 'encoding' => 'utf8', 'cacheMetadata' => true, 'quoteIdentifiers' => false, ]); ConnectionManager::alias('test_debug_kit', 'debug_kit'); // Fixate now to avoid one-second-leap-issues Chronos::setTestNow(Chronos::now()); // Fixate sessionid early on, as php7.2+ // does not allow the sessionid to be set after stdout // has been written to. session_id('cli'); // Connection aliasing needs to happen before migrations are run. // Otherwise, table objects inside migrations would use the default datasource ConnectionHelper::addTestAliases(); // Use migrations to build test database schema. // // Will rebuild the database if the migration state differs // from the migration history in files. // // If you are not using CakePHP's migrations you can // hook into your migration tool of choice here or // load schema from a SQL dump file with // use Cake\TestSuite\Fixture\SchemaLoader; // (new SchemaLoader())->loadSqlFiles('./tests/schema.sql', 'test'); (new Migrator())->run();