Simplified and united configs for tests

This commit is contained in:
Alejandro Celaya
2019-01-26 09:42:01 +01:00
parent 87ba7a7179
commit c4af1471f0
7 changed files with 65 additions and 52 deletions

View File

@@ -6,18 +6,8 @@ use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\ServiceManager;
// If the "--test" flag was provided, we are on a test environment
$isTest = false;
foreach ($_SERVER['argv'] as $i => $arg) {
if ($arg === '--test') {
unset($_SERVER['argv'][$i]);
$isTest = true;
break;
}
}
/** @var ContainerInterface|ServiceManager $container */
$container = $isTest ? include __DIR__ . '/test-container.php' : include __DIR__ . '/container.php';
$container = include __DIR__ . '/container.php';
$em = $container->get(EntityManager::class);
return ConsoleRunner::createHelperSet($em);