Skip to content

Commit ce0b5a4

Browse files
committed
Fixed compatibility with Nette 2.3
1 parent eface33 commit ce0b5a4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Module/Nette.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ public function _before(TestCase $test)
5252
$this->configurator = new Configurator();
5353
$this->configurator->setDebugMode(FALSE);
5454
$this->configurator->setTempDirectory($tempDir);
55-
$this->configurator->addParameters([
56-
'container' => [
57-
'class' => $this->getContainerClass(),
58-
],
59-
]);
55+
if (!class_exists('Nette\DI\ContainerLoader')) { // Nette 2.2 compatibility
56+
$this->configurator->addParameters([
57+
'container' => [
58+
'class' => $this->getContainerClass(),
59+
],
60+
]);
61+
}
6062
$this->configurator->onCompile[] = function ($config, Compiler $compiler) {
6163
$compiler->addExtension('arachne.codeception', new CodeceptionExtension());
6264
};
@@ -69,9 +71,8 @@ public function _before(TestCase $test)
6971

7072
// Generates and loads the container class.
7173
// The actual container is created later.
72-
$this->configurator->createContainer();
74+
$class = get_class($this->configurator->createContainer());
7375

74-
$class = $this->getContainerClass();
7576
// Cannot use $this->configurator->createContainer() directly beacuse it would call $container->initialize().
7677
// Container initialization is called laiter by NetteConnector.
7778
$this->container = new $class;

0 commit comments

Comments
 (0)