public function testBasicSetFileContent() { $value = uniqid('test:'); $o = new StaticFileModel(); $o->setFileContent($value); $this->assertEquals($value, $o->getFileContent()); }
public function testBasicSetLastModifed() { $now = date('Y-m-d'); $o = new StaticFileModel(); $o->setLastModified($now); $this->assertEquals($now, $o->getLastModified()); }
public function fetch($includePath) { $oModel = $this->getModel(); /* @var StaticFileModel $oModel */ if (StaticFileModel::isValid($oModel)) { return $oModel->getFileContent(); } else { return parent::fetch($includePath); } }
public function handleRequest(HttpRequestA $oHttpRequest) { $oModel = new StaticFileModel(); $oModel->setFilePath($this->sFilePath); return $oModel; }
public function testBasicGetFilePath() { $o = new StaticFileModel(); $o->setFilePath(__FILE__); $this->assertEquals(__FILE__, $o->getFilePath()); }
public function testBasic__get() { $o = new StaticFileModel(); $o->setFilePath(__FILE__); $this->assertEquals(file_get_contents(__FILE__), $o->getFileContent()); }
public function testGetLastModifiedMatchesFilemtimeOfFile() { $o = new StaticFileModel(); $o->setFilePath(__FILE__); $this->assertEquals(date('Y-m-d G:i:s', filemtime(__FILE__)), $o->getLastModified()); }
public function testGetFileNameMatchesAfterSet() { $o = new StaticFileModel(); $o->setFilePath(__FILE__); $this->assertEquals(basename(__FILE__), $o->getFileName()); }