mockApplication(); $this->testViewPath = Yii::getAlias('@yiiunit/runtime') . DIRECTORY_SEPARATOR . str_replace('\\', '_', get_class($this)) . uniqid(); FileHelper::createDirectory($this->testViewPath); } public function tearDown() { FileHelper::removeDirectory($this->testViewPath); parent::tearDown(); } /** * @see https://github.com/yiisoft/yii2/issues/13058 */ public function testExceptionOnRenderFile() { $view = new View(); $exceptionViewFile = $this->testViewPath . DIRECTORY_SEPARATOR . 'exception.php'; file_put_contents($exceptionViewFile, <<<'PHP'