Commit a6dd9d37 by Ivo Kund Committed by Alexander Makarov

Fixed #6978: Dependency Injection Container not reset when destroying…

Fixed #6978: Dependency Injection Container not reset when destroying application in functional tests
parent beacdf65
...@@ -4,7 +4,7 @@ Yii Framework 2 Codeception extension Change Log ...@@ -4,7 +4,7 @@ Yii Framework 2 Codeception extension Change Log
2.0.3 under development 2.0.3 under development
----------------------- -----------------------
- no changes in this release. - Bug #6978: DI Container is not reset when destroying application in functional tests (ivokund)
2.0.2 January 11, 2015 2.0.2 January 11, 2015
......
...@@ -12,6 +12,7 @@ use yii\base\InvalidConfigException; ...@@ -12,6 +12,7 @@ use yii\base\InvalidConfigException;
use Codeception\TestCase\Test; use Codeception\TestCase\Test;
use yii\base\UnknownMethodException; use yii\base\UnknownMethodException;
use yii\base\UnknownPropertyException; use yii\base\UnknownPropertyException;
use yii\di\Container;
use yii\test\ActiveFixture; use yii\test\ActiveFixture;
use yii\test\BaseActiveFixture; use yii\test\BaseActiveFixture;
use yii\test\FixtureTrait; use yii\test\FixtureTrait;
...@@ -116,6 +117,7 @@ class TestCase extends Test ...@@ -116,6 +117,7 @@ class TestCase extends Test
$config['class'] = 'yii\web\Application'; $config['class'] = 'yii\web\Application';
} }
Yii::$container = new Container();
return Yii::createObject($config); return Yii::createObject($config);
} else { } else {
throw new InvalidConfigException('Please provide a configuration array to mock up an application.'); throw new InvalidConfigException('Please provide a configuration array to mock up an application.');
...@@ -128,5 +130,6 @@ class TestCase extends Test ...@@ -128,5 +130,6 @@ class TestCase extends Test
protected function destroyApplication() protected function destroyApplication()
{ {
Yii::$app = null; Yii::$app = null;
Yii::$container = new Container();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment