Skip to content

Commit b1a67f6

Browse files
Fixed tests (#25)
1 parent da700fb commit b1a67f6

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/TestCase.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
use Yiisoft\Cache\CacheInterface;
1515
use Yiisoft\Db\Connection\ConnectionInterface;
1616
use Yiisoft\Db\Sqlite\Connection as SqlLiteConnection;
17+
use Yiisoft\Definitions\DynamicReference;
18+
use Yiisoft\Definitions\Reference;
1719
use Yiisoft\Di\Container;
1820
use Yiisoft\EventDispatcher\Dispatcher\Dispatcher;
1921
use Yiisoft\EventDispatcher\Provider\Provider;
20-
use Yiisoft\Definitions\Reference;
2122
use Yiisoft\Log\Logger;
2223
use Yiisoft\Log\Target\Db\DbTarget;
2324
use Yiisoft\Profiler\Profiler;
@@ -49,26 +50,32 @@ protected function getContainer(): Container
4950
if ($this->container === null) {
5051
$this->container = new Container([
5152
Aliases::class => [
52-
'@root' => dirname(__DIR__, 2),
53-
'@runtime' => __DIR__ . '/runtime',
54-
'@yiisoft/yii/db/migration' => '@root',
53+
'class' => Aliases::class,
54+
'__construct()' => [
55+
'@root' => dirname(__DIR__, 2),
56+
'@runtime' => __DIR__ . '/runtime',
57+
'@yiisoft/yii/db/migration' => '@root',
58+
],
5559
],
5660

5761
CacheInterface::class => [
5862
'class' => Cache::class,
5963
'__construct()' => [Reference::to(ArrayCache::class)],
6064
],
6165

62-
LoggerInterface::class => static fn (ContainerInterface $container) => new Logger([
66+
Logger::class => static fn (ContainerInterface $container) => new Logger([
6367
new DbTarget($container->get(ConnectionInterface::class), 'test-table-1'),
6468
new DbTarget($container->get(ConnectionInterface::class), 'test-table-2'),
6569
]),
6670

71+
LoggerInterface::class => Logger::class,
72+
6773
ConnectionInterface::class => [
6874
'class' => SqlLiteConnection::class,
6975
'__construct()' => [
7076
'sqlite:' . self::DB_FILE,
7177
],
78+
'setLogger()' => [DynamicReference::to(Logger::class)],
7279
],
7380

7481
MigrationInformerInterface::class => NullMigrationInformer::class,

0 commit comments

Comments
 (0)