Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Yii User Change Log

## 1.0.2 under development
## 2.0.0 under development

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

## 1.0.1 June 15, 2022

- Enh #55: Add support for `2.0`, `3.0` versions of `psr/log` (rustamwin)
- Enh #55: Add support for `2.0`, `3.0` versions of `psr/log` (@rustamwin)

## 1.0.0 December 22, 2021

- Initial release.
- Initial release.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"config-plugin": {
"params": "params.php",
"web": "web.php"
"di-web": "di-web.php"
}
},
"config": {
Expand Down
File renamed without changes.
29 changes: 16 additions & 13 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Yiisoft\User\Tests\Support\MockIdentityRepository;
use Yiisoft\User\UserAuth;

use function array_merge;
use function dirname;

final class ConfigTest extends TestCase
Expand Down Expand Up @@ -90,23 +89,27 @@ private function createContainer(?array $params = null): Container
{
return new Container(
ContainerConfig::create()->withDefinitions(
$this->getWebDefinitions($params)
$this->getDiConfig($params)
+
[
EventDispatcherInterface::class => SimpleEventDispatcher::class,
IdentityRepositoryInterface::class => MockIdentityRepository::class,
ResponseFactoryInterface::class => ResponseFactory::class,
LoggerInterface::class => SimpleLogger::class,
]
),
);
}

private function getWebDefinitions(?array $params = null): array
private function getDiConfig(?array $params = null): array
{
if ($params === null) {
$params = require dirname(__DIR__) . '/config/params.php';
}

return array_merge(require dirname(__DIR__) . '/config/web.php', [
EventDispatcherInterface::class => SimpleEventDispatcher::class,
IdentityRepositoryInterface::class => MockIdentityRepository::class,
ResponseFactoryInterface::class => ResponseFactory::class,
LoggerInterface::class => SimpleLogger::class,
]);
$params ??= $this->getParams();
return require dirname(__DIR__) . '/config/di-web.php';
}

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

private function getInaccessibleProperty(object $object, string $propertyName)
Expand Down