Esempio n. 1
0
 public function testExecuteNotReadable()
 {
     // If running as root you can always write, so this test should be
     // skipped when running as root.
     if (!ezcBaseFeatures::hasFunction("posix_getuid") || posix_getuid() == 0) {
         return;
     }
     copy($this->templateCompiledPath . "full-14862b79ceaf01443626bd5d564c53e2.php", $this->templateStorePath . "full-14862b79ceaf01443626bd5d564c53e2.php");
     // This only works on Linux/Unix, what to do here on other platforms?
     $old = umask(0);
     chmod($this->templateStorePath . "full-14862b79ceaf01443626bd5d564c53e2.php", 0222);
     umask($old);
     $conf = new ezcTemplateCompiledCode('14862b79ceaf01443626bd5d564c53e2', $this->templateStorePath . 'full-14862b79ceaf01443626bd5d564c53e2.php');
     self::assertTrue(file_exists($conf->path), "Compiled file <" . $conf->path . "> should exist.");
     self::assertSame(false, $conf->isValid(), "isValid() should return false.");
 }