Browse Source

Fixed #6978: Dependency Injection Container not reset when destroying application in functional tests

tags/2.0.3
Ivo Kund 10 years ago committed by Alexander Makarov
parent
commit
a6dd9d37d5
  1. 2
      extensions/codeception/CHANGELOG.md
  2. 3
      extensions/codeception/TestCase.php

2
extensions/codeception/CHANGELOG.md

@ -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

3
extensions/codeception/TestCase.php

@ -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
$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
protected function destroyApplication() protected function destroyApplication()
{ {
Yii::$app = null; Yii::$app = null;
Yii::$container = new Container();
} }
} }

Loading…
Cancel
Save