Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

Commit d960f43

Browse files
authored
Merge pull request liip#428 from tomtomau/fix-1x-special-container
Access special test container in getContainer(). Closes liip#427
2 parents eb607b8 + 31e1c4e commit d960f43

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Test/WebTestCase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ protected function getContainer()
264264
$kernel = $this->createKernel($options);
265265
$kernel->boot();
266266

267-
$this->containers[$cacheKey] = $kernel->getContainer();
267+
$baseContainer = $kernel->getContainer();
268+
269+
// Try to check for the special test container
270+
$this->containers[$cacheKey] = $baseContainer->has('test.service_container') ? $baseContainer->get('test.service_container') : $baseContainer;
268271
}
269272

270273
if (isset($tmpKernelDir)) {

0 commit comments

Comments
 (0)