Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mabumusa1 committed Mar 31, 2023
1 parent 15233dc commit 14c2174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
9 changes: 1 addition & 8 deletions app/bundles/CoreBundle/Test/AbstractMauticTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,15 @@ protected function setUp(): void
protected function setUpSymfony(array $defaultConfigOptions = []): void
{
putenv('MAUTIC_CONFIG_PARAMETERS='.json_encode($defaultConfigOptions));
EnvLoader::load();

$this->client = static::createClient($this->clientOptions, $this->clientServer);
$this->client->disableReboot();
$this->client->followRedirects(true);

$this->em = self::$container->get('doctrine')->getManager();
$this->connection = $this->em->getConnection();
$envVars = [
'MYSQL_PWD' => $this->connection->getPassword(),
'db_host' => $this->connection->getHost(),
'db_port' => $this->connection->getPort(),
'db_user' => $this->connection->getUsername(),
'db_name' => $this->connection->getDatabase(),
];

var_dump($envVars);
$this->router = self::$container->get('router');
$scheme = $this->router->getContext()->getScheme();
$secure = 0 === strcasecmp($scheme, 'https');
Expand Down
10 changes: 5 additions & 5 deletions app/config/config_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
'connections' => [
'default' => [
'driver' => 'pdo_mysql',
'host' => getenv('DB_HOST') ?: '%mautic.db_host%',
'port' => getenv('DB_PORT') ?: '%mautic.db_port%',
'dbname' => getenv('DB_NAME') ?: '%mautic.db_name%',
'user' => getenv('DB_USER') ?: '%mautic.db_user%',
'password' => getenv('DB_PASSWD') ?: '%mautic.db_password%',
'host' => '%env("DB_HOST")%' ?: '%mautic.db_host%',
'port' => '%env("DB_PORT")%' ?: '%mautic.db_port%',
'dbname' => '%env("DB_NAME")%' ?: '%mautic.db_name%',
'user' => '%env("DB_USER")%' ?: '%mautic.db_user%',
'password' => '%env("DB_PASSWD")%' ?: '%mautic.db_password%',
'charset' => 'utf8mb4',
// Prevent Doctrine from crapping out with "unsupported type" errors due to it examining all tables in the database and not just Mautic's
'mapping_types' => [
Expand Down

0 comments on commit 14c2174

Please sign in to comment.