Skip to content

Commit c02abdb

Browse files
committed
:octocat:
1 parent 09d08e2 commit c02abdb

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"require": {
2424
"php": "^7.2",
2525
"chillerlan/php-settings-container": "^1.0",
26+
"chillerlan/php-traits": "^3.0",
2627
"psr/simple-cache": "^1.0",
2728
"psr/log": "^1.0"
2829
},
2930
"require-dev": {
3031
"chillerlan/php-dotenv": "^1.0",
31-
"chillerlan/php-traits": "^2.0",
32-
"chillerlan/php-cache": "^2.0",
33-
"chillerlan/php-log": "^2.0",
32+
"chillerlan/php-cache": "dev-master",
33+
"chillerlan/php-log": "^3.0",
3434
"phpunit/phpunit": "^7.4"
3535
},
3636
"autoload": {

tests/DatabaseTest.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
2222
DriverInterface, FirebirdPDO, MSSqlSrv, MSSqlSrvPDO, MySQLiDrv, MySQLPDO, PostgreSQL, PostgreSQLPDO, SQLitePDO
2323
};
2424
use chillerlan\Database\Query\QueryBuilder;
25+
use chillerlan\DotEnv\DotEnv;
2526
use chillerlan\Logger\{
2627
Log, LogOptions, Output\LogOutputAbstract
2728
};
28-
use chillerlan\SimpleCache\{
29-
Cache, Drivers\MemoryCacheDriver
30-
};
31-
use chillerlan\Traits\DotEnv;
29+
use chillerlan\SimpleCache\MemoryCache;
3230
use PHPUnit\Framework\TestCase;
3331
use Psr\Log\LogLevel;
3432
use ReflectionClass, ReflectionMethod;
@@ -81,7 +79,7 @@ class DatabaseTest extends TestCase{
8179
protected $dialect;
8280

8381
/**
84-
* @var \chillerlan\Traits\DotEnv
82+
* @var \chillerlan\DotEnv\DotEnv
8583
*/
8684
protected $env;
8785

@@ -174,15 +172,15 @@ protected function dbInstance(string $driver, string $env_prefix, bool $skip_on_
174172

175173
$this->options = new DatabaseOptions(array_merge([
176174
'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'},
183181
], $options));
184182

185-
$this->cache = new Cache(new MemoryCacheDriver);
183+
$this->cache = new MemoryCache;
186184
$this->db = new Database($this->options, $cached ? $this->cache : null);
187185
$this->db->setLogger($this->logger);
188186

0 commit comments

Comments
 (0)