Exemplo n.º 1
0
 /**
  * Test deleting a temporary template file
  */
 public function testDelete()
 {
     copy($this->templatePath . "zhadum.ezt", $this->templateStorePath . "zhadum.ezt");
     $src = new ezcTemplateSourceCode($this->templateStorePath . "zhadum.ezt", "planet:zhadum.ezt", "The abyss.");
     self::assertTrue(file_exists($this->templateStorePath . "zhadum.ezt"), 'Temporary template file <' . $this->templateStorePath . 'zhadum.ezt> does not exists, copy failed.');
     $src->delete();
     self::assertSame($this->templateStorePath . "zhadum.ezt", $src->stream, 'Property <stream> does not return correct value.');
     self::assertSame("planet:zhadum.ezt", $src->resource, 'Property <resource> does not return correct value.');
     self::assertSame("The abyss.", $src->code, 'Property <code> does not return correct value.');
     self::assertSame(false, file_exists($this->templateStorePath . "zhadum.ezt"), 'Temporary template file <' . $this->templateStorePath . 'zhadum.ezt> still exist, was supposed to be unlinked.');
     self::assertSame(false, $src->isAvailable(), 'Temporary template file <' . $this->templateStorePath . 'zhadum.ezt> does not return false in isAvailable().');
     //        self::assertSame( null, $src->context, 'Property <context> does not return correct value.' );
 }