You don't need to worry about application instances and isolation because application will be created [each time](https://github.com/yiisoft/yii2/blob/master/extensions/codeception/TestCase.php#L31) before any of test method will be executed in test case.
You can mock application in a different way. For this purposes you have method [`mockApplication`](https://github.com/yiisoft/yii2/blob/master/extensions/codeception/TestCase.php#L55) available in your test case.
This method creates new application instance and replaces old one with it and is handy when you need to create application with a config that is different from other test methods in the current test suite. For example:
```php
use\yii\codeception\TestCase;
classSomeMyTestextendsTestCase
{
publicfunctiontestOne()
{
...
}
publicfunctiontestTwo()
{
$this->mockApplication([
'language'=>'ru-RU',
'components'=>[
'db'=>[
//your custom configuration here
],
],
],
]
]);
];
//your expectations and assertions goes here
}
publicfunctiontestThree()
{
...
}
}
}
```
```
Additional debug output
-----------------------
Because of Codeception buffers all output you can't make simple `var_dump()` in the TestCase, instead you need to use
Because of Codeception buffers all output you can't make simple `var_dump()` in the TestCase, instead you need to use
`Codeception\Util\Debug::debug()` function and then run test with `--debug` key, for example:
`Codeception\Util\Debug::debug()` function and then run test with `--debug` key, for example: