mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 23:18:37 +03:00
Ensured same testing database is used to generate with entities and to run functional tests
This commit is contained in:
parent
0bd9f1e19f
commit
91442a3379
4 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
extension="sqlite.so"
|
|
@ -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__);
|
||||
|
|
Loading…
Reference in a new issue