diff --git a/.travis.yml b/.travis.yml index 7062a5a4..e66a102e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ php: before_install: - phpenv config-add data/infra/travis-php/memcached.ini - phpenv config-add data/infra/travis-php/apcu.ini - - phpenv config-add data/infra/travis-php/sqlite.ini before_script: - composer self-update diff --git a/config/cli-config.php b/config/cli-config.php index b90e9ddf..59373bbd 100644 --- a/config/cli-config.php +++ b/config/cli-config.php @@ -24,7 +24,7 @@ if ($isTest) { $config = $container->get('config'); $config['entity_manager']['connection'] = [ 'driver' => 'pdo_sqlite', - 'memory' => true, + 'path' => realpath(sys_get_temp_dir()) . '/shlink-tests.db', ]; $container->setService('config', $config); } diff --git a/data/infra/travis-php/sqlite.ini b/data/infra/travis-php/sqlite.ini deleted file mode 100644 index 90fc1598..00000000 --- a/data/infra/travis-php/sqlite.ini +++ /dev/null @@ -1 +0,0 @@ -extension="sqlite.so" diff --git a/func_tests_bootstrap.php b/func_tests_bootstrap.php index 2f864a82..6a4300f3 100644 --- a/func_tests_bootstrap.php +++ b/func_tests_bootstrap.php @@ -10,8 +10,20 @@ if (! file_exists('.env')) { touch('.env'); } +$shlinkDbPath = realpath(sys_get_temp_dir()) . '/shlink-tests.db'; +if (file_exists($shlinkDbPath)) { + unlink($shlinkDbPath); +} + /** @var ServiceManager $sm */ $sm = require __DIR__ . '/config/container.php'; +$sm->setAllowOverride(true); +$config = $sm->get('config'); +$config['entity_manager']['connection'] = [ + 'driver' => 'pdo_sqlite', + 'path' => $shlinkDbPath, +]; +$sm->setService('config', $config); // Create database $process = new Process('vendor/bin/doctrine orm:schema-tool:create --no-interaction -q --test', __DIR__);