mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 15:13:59 -06: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
@ -13,7 +13,6 @@ php:
|
|||||||
before_install:
|
before_install:
|
||||||
- phpenv config-add data/infra/travis-php/memcached.ini
|
- 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/apcu.ini
|
||||||
- phpenv config-add data/infra/travis-php/sqlite.ini
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- composer self-update
|
- composer self-update
|
||||||
|
@ -24,7 +24,7 @@ if ($isTest) {
|
|||||||
$config = $container->get('config');
|
$config = $container->get('config');
|
||||||
$config['entity_manager']['connection'] = [
|
$config['entity_manager']['connection'] = [
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'memory' => true,
|
'path' => realpath(sys_get_temp_dir()) . '/shlink-tests.db',
|
||||||
];
|
];
|
||||||
$container->setService('config', $config);
|
$container->setService('config', $config);
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
extension="sqlite.so"
|
|
@ -10,8 +10,20 @@ if (! file_exists('.env')) {
|
|||||||
touch('.env');
|
touch('.env');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$shlinkDbPath = realpath(sys_get_temp_dir()) . '/shlink-tests.db';
|
||||||
|
if (file_exists($shlinkDbPath)) {
|
||||||
|
unlink($shlinkDbPath);
|
||||||
|
}
|
||||||
|
|
||||||
/** @var ServiceManager $sm */
|
/** @var ServiceManager $sm */
|
||||||
$sm = require __DIR__ . '/config/container.php';
|
$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
|
// Create database
|
||||||
$process = new Process('vendor/bin/doctrine orm:schema-tool:create --no-interaction -q --test', __DIR__);
|
$process = new Process('vendor/bin/doctrine orm:schema-tool:create --no-interaction -q --test', __DIR__);
|
||||||
|
Loading…
Reference in New Issue
Block a user