public function testDescription() { $html = new GtkdocHtml(@file_get_contents('AdgGtkLayout.html')); $this->assertEquals($html->getDescription(), ''); $this->assertTrue($html->process()); $this->assertEquals($html->getDescription(), 'AdgGtkLayout — A scrollable AdgGtkArea based widget'); }
/** * Synchronize the database with the gtk-doc file. * * $this->Root and $this->URLSegment *must* be set, otherwise sync() * will not know how to access the gtk-doc file. * * The title needs to be passed in because it is defined in the * devhelp file, not in the gtk-doc file. * * @param String $title The title of the section * @param Int $sort A sort index * @return Boolean true on success, false on errors. */ public function sync($title, $sort = null) { if ($this->up_to_date($title)) { return true; } $html = new GtkdocHtml(@file_get_contents($this->GtkdocFile)); $html->setBaseURL($this->RelativeLink()); if (!$html->process()) { return false; } isset($sort) or $sort = $this->Sort; $this->update(array('Title' => $title, 'Content' => $html->getHtml(), 'MetaDescription' => $html->getDescription(), 'Sort' => $sort)); return $this->write() > 0; }