mirror of
https://github.com/code-rhapsodie/ezmigrationbundle2.git
synced 2026-03-24 06:42:19 +01:00
23 lines
899 B
PHP
23 lines
899 B
PHP
<?php
|
|
|
|
use Symfony\Component\Dotenv\Dotenv;
|
|
|
|
// try to load autoloader both when extension is top-level project and when it is installed as part of a working eZPlatform
|
|
if (!file_exists($file = __DIR__.'/../vendor/autoload.php') && !file_exists($file = __DIR__.'/../../../../vendor/autoload.php')) {
|
|
throw new \RuntimeException('Install the dependencies to run the test suite.');
|
|
}
|
|
|
|
require $file;
|
|
|
|
if (!is_dir($configDir = __DIR__.'/../vendor/ezsystems/ezplatform/config') && !is_dir($configDir = __DIR__.'/../../../../config')) {
|
|
throw new \RuntimeException('Unsupported directory layout.');
|
|
}
|
|
|
|
if (file_exists($configDir.'/bootstrap.php')) {
|
|
require $configDir.'/bootstrap.php';
|
|
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
|
|
(new Dotenv())->bootEnv(dirname($configDir).'/.env');
|
|
}
|
|
|
|
Kaliop\eZMigrationBundle\DependencyInjection\eZMigrationExtension::$loadTestConfig = true;
|