|
22 | 22 | DriverInterface, FirebirdPDO, MSSqlSrv, MSSqlSrvPDO, MySQLiDrv, MySQLPDO, PostgreSQL, PostgreSQLPDO, SQLitePDO
|
23 | 23 | };
|
24 | 24 | use chillerlan\Database\Query\QueryBuilder;
|
| 25 | +use chillerlan\DotEnv\DotEnv; |
25 | 26 | use chillerlan\Logger\{
|
26 | 27 | Log, LogOptions, Output\LogOutputAbstract
|
27 | 28 | };
|
28 |
| -use chillerlan\SimpleCache\{ |
29 |
| - Cache, Drivers\MemoryCacheDriver |
30 |
| -}; |
31 |
| -use chillerlan\Traits\DotEnv; |
| 29 | +use chillerlan\SimpleCache\MemoryCache; |
32 | 30 | use PHPUnit\Framework\TestCase;
|
33 | 31 | use Psr\Log\LogLevel;
|
34 | 32 | use ReflectionClass, ReflectionMethod;
|
@@ -81,7 +79,7 @@ class DatabaseTest extends TestCase{
|
81 | 79 | protected $dialect;
|
82 | 80 |
|
83 | 81 | /**
|
84 |
| - * @var \chillerlan\Traits\DotEnv |
| 82 | + * @var \chillerlan\DotEnv\DotEnv |
85 | 83 | */
|
86 | 84 | protected $env;
|
87 | 85 |
|
@@ -174,15 +172,15 @@ protected function dbInstance(string $driver, string $env_prefix, bool $skip_on_
|
174 | 172 |
|
175 | 173 | $this->options = new DatabaseOptions(array_merge([
|
176 | 174 | 'driver' => $driver,
|
177 |
| - 'host' => $this->env->get($env_prefix.'_HOST'), |
178 |
| - 'port' => $this->env->get($env_prefix.'_PORT'), |
179 |
| - 'socket' => $this->env->get($env_prefix.'_SOCKET'), |
180 |
| - 'database' => $this->env->get($env_prefix.'_DATABASE'), |
181 |
| - 'username' => $this->env->get($env_prefix.'_USERNAME'), |
182 |
| - 'password' => $this->env->get($env_prefix.'_PASSWORD'), |
| 175 | + 'host' => $this->env->{$env_prefix.'_HOST'}, |
| 176 | + 'port' => $this->env->{$env_prefix.'_PORT'}, |
| 177 | + 'socket' => $this->env->{$env_prefix.'_SOCKET'}, |
| 178 | + 'database' => $this->env->{$env_prefix.'_DATABASE'}, |
| 179 | + 'username' => $this->env->{$env_prefix.'_USERNAME'}, |
| 180 | + 'password' => $this->env->{$env_prefix.'_PASSWORD'}, |
183 | 181 | ], $options));
|
184 | 182 |
|
185 |
| - $this->cache = new Cache(new MemoryCacheDriver); |
| 183 | + $this->cache = new MemoryCache; |
186 | 184 | $this->db = new Database($this->options, $cached ? $this->cache : null);
|
187 | 185 | $this->db->setLogger($this->logger);
|
188 | 186 |
|
|
0 commit comments