mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 12:13:13 +08:00
First version of functional tests working
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use ShlinkioTest\Shlink\Common\DbUnit\DatabaseTestCase;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
@@ -13,17 +12,10 @@ if (! file_exists('.env')) {
|
||||
|
||||
/** @var ServiceManager $sm */
|
||||
$sm = require __DIR__ . '/config/container.php';
|
||||
$sm->setAllowOverride(true);
|
||||
$config = $sm->get('config');
|
||||
$config['entity_manager']['connection'] = [
|
||||
'driver' => 'pdo_sqlite',
|
||||
'memory' => true,
|
||||
];
|
||||
$sm->setService('config', $config);
|
||||
|
||||
$process = new Process('vendor/bin/doctrine-migrations migrations:migrate --no-interaction -q', __DIR__);
|
||||
// Create database
|
||||
$process = new Process('vendor/bin/doctrine orm:schema-tool:create --no-interaction -q --test', __DIR__);
|
||||
$process->inheritEnvironmentVariables()
|
||||
->setTimeout(60 * 5) // 5 minutes
|
||||
->mustRun();
|
||||
|
||||
DatabaseTestCase::$em = $sm->get(EntityManagerInterface::class);
|
||||
DatabaseTestCase::$em = $sm->get('em');
|
||||
|
||||
Reference in New Issue
Block a user