function test_link()
 {
     $parse = PluginSonotsMetapage::link('Hoge/A', 'A', 'page');
     $assert = '<span class="noexists">A<a href="?cmd=edit&amp;page=Hoge%2FA">?</a></span>';
     $this->assertEqual($parse, $assert);
     $parse = PluginSonotsMetapage::link('Hoge/A', 'A', 'anchor');
     $assert = '<a href="#z758465a6084944c5973bedbbfaf08be9">A</a>';
     $this->assertEqual($parse, $assert);
     $parse = PluginSonotsMetapage::link('Hoge/A', 'A', 'off');
     $assert = 'A';
     $this->assertEqual($parse, $assert);
 }
 /**
  * Generate link property of this page
  *
  * @access public
  * @param string $optlinkstr
  * @param string $optlink
  * @param string $currdir computed as default
  * @param boolean $usecache use Toc cache or not (used for title and firsthead)
  * @uses linkstr
  * @uses link
  */
 function gen_link($optlinkstr = 'relative', $optlink = 'page', $currdir = '', $usecache = true)
 {
     $this->gen_linkstr($optlinkstr, $currdir, $usecache);
     $this->link = $this->exist ? PluginSonotsMetapage::link($this->page, $this->linkstr, $optlink) : $this->linkstr;
 }