Skip to content

Commit

Permalink
Adapt configuration group names to Yii conventions (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Feb 15, 2023
1 parent c15bbf5 commit dafe269
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## 2.0.0 under development

- Chg #40: Raise the minimum `psr/simple-cache` version to `^2.0|^3.0` and the minimum PHP version to `^8.0` (@dehbka)
- Chg #45: Adapt configuration group names to Yii conventions (@vjik)

## 1.0.2 April 13, 2021

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -30,7 +30,8 @@
"rector/rector": "^0.15.13",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.6"
"vimeo/psalm": "^4.30|^5.6",
"yiisoft/di": "^1.2"
},
"autoload": {
"psr-4": {
Expand All @@ -50,7 +51,7 @@
"source-directory": "config"
},
"config-plugin": {
"common": "common.php",
"di": "di.php",
"params": "params.php"
}
},
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions tests/ConfigTest.php
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Cache\Memcached\Tests;

use PHPUnit\Framework\TestCase;
use Yiisoft\Cache\Memcached\Memcached;
use Yiisoft\Di\Container;
use Yiisoft\Di\ContainerConfig;

final class ConfigTest extends TestCase
{
public function testBase(): void
{
$container = $this->createContainer();

$memcached = $container->get(Memcached::class);

$this->assertInstanceOf(Memcached::class, $memcached);
}

private function createContainer(): Container
{
return new Container(
ContainerConfig::create()->withDefinitions(
$this->getDiConfig()
)
);
}

private function getDiConfig(): array
{
$params = $this->getParams();
return require dirname(__DIR__) . '/config/di.php';
}

private function getParams(): array
{
return require dirname(__DIR__) . '/config/params.php';
}
}

0 comments on commit dafe269

Please sign in to comment.