lithium\tests\cases\template\view\CompilerTest::testFallbackWithNonWritableDirectory PHP Метод

testFallbackWithNonWritableDirectory() публичный Метод

    public function testFallbackWithNonWritableDirectory()
    {
        $backup = error_reporting();
        error_reporting(E_ALL);
        $path = $this->_path;
        $file = $this->_file;
        $this->assertException('/failed to open stream/', function () use($path, $file) {
            Compiler::template("{$path}/{$file}", array('path' => Libraries::get(true, 'path') . '/foo', 'fallback' => true));
        });
        $expected = '/(Could not write compiled template|failed to open stream)/';
        $this->assertException($expected, function () use($path, $file) {
            $result = Compiler::template("{$path}/{$file}", array('path' => Libraries::get(true, 'path') . '/foo', 'fallback' => false));
        });
        error_reporting($backup);
    }