/** * @group dev */ public function testGetCompiledPathRaiseException() { $pathCompiled = getcwd() . '/tests/module/Application/compiled/'; $folderCompiler = $pathCompiled . 'index'; $msg = sprintf('Cannot write compile view to "%s"', $folderCompiler); $this->setExpectedException(\Phalex\Mvc\Exception\RuntimeException::class, $msg); $di = $this->getMock(Di::class, ['get'], [[]]); $viewDir = getcwd() . '/tests/module/Application/view/'; $view = new View(['di' => $di, 'views_dir' => $viewDir]); $viewVolt = '/index/index.volt'; if (file_exists($folderCompiler)) { rmdir($folderCompiler); } mkdir($folderCompiler, 0555); $view->getCompiledPath($viewDir . $viewVolt, ['path' => $pathCompiled, 'hierarchical' => true, 'extension' => '.com']); }