/** * Test for Theme::loadInfo * * @return void */ public function testLoadInfo() { $this->object->setPath('./themes/original'); $infofile = $this->object->getPath() . '/info.inc.php'; $this->assertTrue($this->object->loadInfo()); $this->assertEquals(filemtime($infofile), $this->object->mtime_info); $this->object->setPath('./themes/original'); $this->object->mtime_info = filemtime($infofile); $this->assertTrue($this->object->loadInfo()); $this->assertEquals('Original', $this->object->getName()); }
/** * returns theme object loaded from given folder * or false if theme is invalid * * @param string $folder path to theme * * @return Theme|false * @static * @access public */ public static function load($folder) { $theme = new Theme(); $theme->setPath($folder); if (!$theme->loadInfo()) { return false; } $theme->checkImgPath(); return $theme; }