diff --git a/extensions/codeception/CHANGELOG.md b/extensions/codeception/CHANGELOG.md index 356d53c..2f088e2 100644 --- a/extensions/codeception/CHANGELOG.md +++ b/extensions/codeception/CHANGELOG.md @@ -4,7 +4,7 @@ Yii Framework 2 Codeception extension Change Log 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 diff --git a/extensions/codeception/TestCase.php b/extensions/codeception/TestCase.php index 9256851..e01073f 100644 --- a/extensions/codeception/TestCase.php +++ b/extensions/codeception/TestCase.php @@ -12,6 +12,7 @@ use yii\base\InvalidConfigException; use Codeception\TestCase\Test; use yii\base\UnknownMethodException; use yii\base\UnknownPropertyException; +use yii\di\Container; use yii\test\ActiveFixture; use yii\test\BaseActiveFixture; use yii\test\FixtureTrait; @@ -116,6 +117,7 @@ class TestCase extends Test $config['class'] = 'yii\web\Application'; } + Yii::$container = new Container(); return Yii::createObject($config); } else { throw new InvalidConfigException('Please provide a configuration array to mock up an application.'); @@ -128,5 +130,6 @@ class TestCase extends Test protected function destroyApplication() { Yii::$app = null; + Yii::$container = new Container(); } }