Skip to content

Commit 66ee80e

Browse files
committed
Merge pull request #17 from WouterJ/fix_16
Finished #16
2 parents c29e319 + 95dea1d commit 66ee80e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Symfony/Cmf/Component/Testing/Functional/BaseTestCase.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Symfony\Cmf\Component\Testing\Functional;
44

55
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6+
use Symfony\Component\DependencyInjection\Container;
67

78
/**
89
* The base class for Functional and Web tests.
@@ -18,7 +19,11 @@ abstract class BaseTestCase extends WebTestCase
1819
protected $db;
1920

2021
protected $dbManagers = array();
21-
protected $containers = array();
22+
23+
/**
24+
* @var Container
25+
*/
26+
protected $container;
2227

2328
/**
2429
* Return the configuration to use when creating the Kernel.
@@ -38,18 +43,16 @@ protected function getKernelConfiguration()
3843
/**
3944
* Gets the container.
4045
*
41-
* @return \Symfony\Component\DependencyInjection\Container
46+
* @return Container
4247
*/
4348
public function getContainer()
4449
{
45-
$hash = md5(serialize($this->settings));
46-
47-
if (!isset($this->containers[$hash])) {
50+
if (null === $this->container) {
4851
$client = $this->createClient($this->getKernelConfiguration());
49-
$this->containers[$hash] = $client->getContainer();
52+
$this->container = $client->getContainer();
5053
}
5154

52-
return $this->containers[$hash];
55+
return $this->container;
5356
}
5457

5558
/**

0 commit comments

Comments
 (0)