|
2 | 2 |
|
3 | 3 | namespace ErrorHeroModule\Spec\Middleware; |
4 | 4 |
|
5 | | -use ArrayObject; |
6 | | -use Aura\Di\Container as AuraContainer; |
7 | | -use Aura\Di\ContainerBuilder as AuraContainerBuilder; |
8 | 5 | use Doctrine\DBAL\Connection; |
9 | 6 | use Doctrine\DBAL\Driver\PDO\MySql\Driver; |
10 | 7 | use Doctrine\ORM\EntityManager; |
|
26 | 23 | given('factory', fn() : MezzioFactory => new MezzioFactory()); |
27 | 24 |
|
28 | 25 | given('mapCreateContainers', fn() : array => [ |
29 | | - AuraContainer::class => (new AuraContainerBuilder())->newInstance(), |
30 | 26 | SymfonyContainerBuilder::class => new SymfonyContainerBuilder(), |
31 | 27 | Psr11PimpleContainer::class => new Psr11PimpleContainer(new PimpleContainer()), |
32 | 28 | ]); |
|
202 | 198 |
|
203 | 199 | $config = []; |
204 | 200 | foreach ($this->mapCreateContainers as $containerClass => $container) { |
205 | | - if ($container instanceof AuraContainer) { |
206 | | - $config = new ArrayObject($config); |
207 | | - } |
208 | 201 |
|
209 | 202 | allow($container)->toReceive('get')->with('config') |
210 | 203 | ->andReturn($config); |
211 | | - if ($container instanceof AuraContainer) { |
212 | | - $config = $config->getArrayCopy(); |
213 | | - } |
214 | 204 |
|
215 | 205 | allow($container)->toReceive('has')->with(EntityManager::class)->andReturn(false); |
216 | 206 |
|
|
242 | 232 |
|
243 | 233 | foreach ($this->mapCreateContainers as $mapCreateContainer) { |
244 | 234 | $config['log']['ErrorHeroModuleLogger']['writers'][0]['options']['db'] = AdapterInterface::class; |
245 | | - if ($mapCreateContainer instanceof AuraContainer) { |
246 | | - $config = new ArrayObject($config); |
247 | | - } |
248 | 235 |
|
249 | 236 | allow($mapCreateContainer)->toReceive('get')->with('config') |
250 | 237 | ->andReturn($config); |
251 | | - if ($mapCreateContainer instanceof AuraContainer) { |
252 | | - $config = $config->getArrayCopy(); |
253 | | - } |
254 | | - |
255 | 238 | allow($mapCreateContainer)->toReceive('has')->with(EntityManager::class)->andReturn(false); |
256 | 239 |
|
257 | 240 | $logging = Double::instance(['extends' => Logging::class, 'methods' => '__construct']); |
|
275 | 258 | foreach ($this->mapCreateContainers as $mapCreateContainer) { |
276 | 259 | $config = $this->config; |
277 | 260 | $config['log']['ErrorHeroModuleLogger']['writers'][0]['options']['db'] = 'my-adapter'; |
278 | | - if ($mapCreateContainer instanceof AuraContainer) { |
279 | | - $config = new ArrayObject($config); |
280 | | - } |
281 | 261 |
|
282 | 262 | allow($mapCreateContainer)->toReceive('get')->with('config') |
283 | 263 | ->andReturn($config); |
284 | | - if ($mapCreateContainer instanceof AuraContainer) { |
285 | | - $config = $config->getArrayCopy(); |
286 | | - } |
287 | 264 |
|
288 | 265 | allow($mapCreateContainer)->toReceive('has')->with(EntityManager::class)->andReturn(false); |
289 | 266 |
|
|
307 | 284 |
|
308 | 285 | $config = $this->config; |
309 | 286 | foreach ($this->mapCreateContainers as $mapCreateContainer) { |
310 | | - if ($mapCreateContainer instanceof AuraContainer) { |
311 | | - $config = new ArrayObject($config); |
312 | | - } |
313 | 287 |
|
314 | 288 | allow($mapCreateContainer)->toReceive('get')->with('config') |
315 | 289 | ->andReturn($config); |
316 | | - if ($mapCreateContainer instanceof AuraContainer) { |
317 | | - $config = $config->getArrayCopy(); |
318 | | - } |
319 | 290 |
|
320 | 291 | allow($mapCreateContainer)->toReceive('has')->with(EntityManager::class)->andReturn(false); |
321 | 292 |
|
|
0 commit comments