Skip to content

Commit

Permalink
Add AttributeResolverFactoryInterface definition to package configu…
Browse files Browse the repository at this point in the history
…ration (#68)
  • Loading branch information
vjik authored Jan 6, 2024
1 parent ba10896 commit f34003c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/di.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

declare(strict_types=1);

use Yiisoft\Hydrator\AttributeHandling\ResolverFactory\AttributeResolverFactoryInterface;
use Yiisoft\Hydrator\AttributeHandling\ResolverFactory\ContainerAttributeResolverFactory;
use Yiisoft\Hydrator\Hydrator;
use Yiisoft\Hydrator\HydratorInterface;

return [
HydratorInterface::class => Hydrator::class,
AttributeResolverFactoryInterface::class => ContainerAttributeResolverFactory::class,
];
4 changes: 4 additions & 0 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use PHPUnit\Framework\TestCase;
use Yiisoft\Di\Container;
use Yiisoft\Di\ContainerConfig;
use Yiisoft\Hydrator\AttributeHandling\ResolverFactory\AttributeResolverFactoryInterface;
use Yiisoft\Hydrator\AttributeHandling\ResolverFactory\ContainerAttributeResolverFactory;
use Yiisoft\Hydrator\Hydrator;
use Yiisoft\Hydrator\HydratorInterface;

Expand All @@ -21,8 +23,10 @@ public function testBase(): void
);

$hydrator = $container->get(HydratorInterface::class);
$attributeResolverFactory = $container->get(AttributeResolverFactoryInterface::class);

$this->assertInstanceOf(Hydrator::class, $hydrator);
$this->assertInstanceOf(ContainerAttributeResolverFactory::class, $attributeResolverFactory);
}

private function getContainerDefinitions(): array
Expand Down

0 comments on commit f34003c

Please sign in to comment.