Skip to content

Commit 94bb931

Browse files
authored
Adapt configuration group names to Yii conventions (#117)
1 parent 9f933ff commit 94bb931

4 files changed

Lines changed: 43 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Yii Cache Change Log
22

3-
## 2.0.1 under development
3+
## 3.0.0 under development
44

5-
- no changes in this release.
5+
- Chg #117: Adapt configuration group names to Yii conventions (@vjik)
66

77
## 2.0.0 June 29, 2022
88

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"rector/rector": "^0.15.2",
4040
"roave/infection-static-analysis-plugin": "^1.16",
4141
"spatie/phpunit-watcher": "^1.23",
42-
"vimeo/psalm": "^4.30|^5.6"
42+
"vimeo/psalm": "^4.30|^5.6",
43+
"yiisoft/di": "^1.2"
4344
},
4445
"provide": {
4546
"psr/simple-cache-implementation": "2.0|3.0"
@@ -67,7 +68,7 @@
6768
"source-directory": "config"
6869
},
6970
"config-plugin": {
70-
"common": "common.php"
71+
"di": "di.php"
7172
}
7273
},
7374
"config": {
File renamed without changes.

tests/ConfigTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Yiisoft\Cache\Tests;
6+
7+
use Yiisoft\Cache\ArrayCache;
8+
use Yiisoft\Cache\Cache;
9+
use Yiisoft\Di\Container;
10+
use Yiisoft\Di\ContainerConfig;
11+
12+
final class ConfigTest extends TestCase
13+
{
14+
public function testBase(): void
15+
{
16+
$container = $this->createContainer();
17+
18+
$yiiCache = $container->get(\Yiisoft\Cache\CacheInterface::class);
19+
$psrCache = $container->get(\Psr\SimpleCache\CacheInterface::class);
20+
21+
$this->assertInstanceOf(Cache::class, $yiiCache);
22+
$this->assertInstanceOf(ArrayCache::class, $psrCache);
23+
}
24+
25+
private function createContainer(): Container
26+
{
27+
return new Container(
28+
ContainerConfig::create()->withDefinitions(
29+
$this->getDiConfig()
30+
)
31+
);
32+
}
33+
34+
private function getDiConfig(): array
35+
{
36+
return require dirname(__DIR__) . '/config/di.php';
37+
}
38+
}

0 commit comments

Comments
 (0)