|
|
@ -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(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|