Skip to content

Commit

Permalink
use ArrayObject check for Aura container instead of PHPDI
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Mar 3, 2019
1 parent 143e958 commit f7ae9db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/Middleware/ExpressiveFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@

$config = [];
foreach ($this->mapCreateContainers as $containerClass => $container) {
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = new ArrayObject($config);
}
allow($container)->toReceive('get')->with('config')
->andReturn($config);
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = $config->getArrayCopy();
}
allow($container)->toReceive('has')->with(EntityManager::class)->andReturn(false);
Expand Down Expand Up @@ -256,12 +256,12 @@

foreach ($this->mapCreateContainers as $container) {
$config['log']['ErrorHeroModuleLogger']['writers'][0]['options']['db'] = Adapter::class;
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = new ArrayObject($config);
}
allow($container)->toReceive('get')->with('config')
->andReturn($config);
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = $config->getArrayCopy();
}
allow($container)->toReceive('has')->with(EntityManager::class)->andReturn(false);
Expand All @@ -287,12 +287,12 @@
foreach ($this->mapCreateContainers as $container) {
$config = $this->config;
$config['log']['ErrorHeroModuleLogger']['writers'][0]['options']['db'] = 'my-adapter';
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = new ArrayObject($config);
}
allow($container)->toReceive('get')->with('config')
->andReturn($config);
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = $config->getArrayCopy();
}
allow($container)->toReceive('has')->with(EntityManager::class)->andReturn(false);
Expand All @@ -317,12 +317,12 @@

$config = $this->config;
foreach ($this->mapCreateContainers as $container) {
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = new ArrayObject($config);
}
allow($container)->toReceive('get')->with('config')
->andReturn($config);
if ($container instanceof PHPDIContainer) {
if ($container instanceof AuraContainer) {
$config = $config->getArrayCopy();
}
allow($container)->toReceive('has')->with(EntityManager::class)->andReturn(false);
Expand Down

0 comments on commit f7ae9db

Please sign in to comment.