2017-10-31 19:26:48 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-10-31 19:26:48 +01:00
|
|
|
namespace Engelsystem\Test\Feature\Database;
|
|
|
|
|
2019-10-13 21:06:24 +02:00
|
|
|
use Engelsystem\Test\Unit\TestCase;
|
2017-10-31 19:26:48 +01:00
|
|
|
|
|
|
|
abstract class DatabaseTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the database config
|
|
|
|
*
|
|
|
|
* @return string[]
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
protected function getDbConfig(): array
|
2017-10-31 19:26:48 +01:00
|
|
|
{
|
|
|
|
$configValues = require __DIR__ . '/../../../config/config.default.php';
|
|
|
|
$configFile = __DIR__ . '/../../../config/config.php';
|
|
|
|
|
|
|
|
if (file_exists($configFile)) {
|
|
|
|
$configValues = array_replace_recursive($configValues, require $configFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $configValues['database'];
|
|
|
|
}
|
|
|
|
}
|