Ejemplo n.º 1
0
 /**
  * FIXME should we test this without internet first?
  *
  * @group internet
  */
 public function testExtensionParameters()
 {
     $extension = new helper_plugin_extension_extension();
     $extension->setExtension('extension');
     $this->assertEquals('extension', $extension->getID());
     $this->assertEquals('extension', $extension->getBase());
     $this->assertEquals('Extension Manager', $extension->getDisplayName());
     $this->assertEquals('Michael Hamann', $extension->getAuthor());
     $this->assertEquals('*****@*****.**', $extension->getEmail());
     $this->assertEquals(md5('*****@*****.**'), $extension->getEmailID());
     $this->assertEquals('https://www.dokuwiki.org/plugin:extension', $extension->getURL());
     $this->assertEquals('Allows managing and installing plugins and templates', $extension->getDescription());
     $this->assertFalse($extension->isTemplate());
     $this->assertTrue($extension->isEnabled());
     $this->assertTrue($extension->isInstalled());
     $this->assertTrue($extension->isBundled());
     $extension->setExtension('testing');
     $this->assertEquals('testing', $extension->getID());
     $this->assertEquals('testing', $extension->getBase());
     $this->assertEquals('Testing Plugin', $extension->getDisplayName());
     $this->assertEquals('Tobias Sarnowski', $extension->getAuthor());
     $this->assertEquals('*****@*****.**', $extension->getEmail());
     $this->assertEquals(md5('*****@*****.**'), $extension->getEmailID());
     $this->assertEquals('http://www.dokuwiki.org/plugin:testing', $extension->getURL());
     $this->assertEquals('Used to test the test framework. Should always be disabled.', $extension->getDescription());
     $this->assertFalse($extension->isTemplate());
     $this->assertFalse($extension->isEnabled());
     $this->assertTrue($extension->isInstalled());
     $this->assertTrue($extension->isBundled());
     $extension->setExtension('template:dokuwiki');
     $this->assertEquals('template:dokuwiki', $extension->getID());
     $this->assertEquals('dokuwiki', $extension->getBase());
     $this->assertEquals('DokuWiki Template', $extension->getDisplayName());
     $this->assertEquals('Anika Henke', $extension->getAuthor());
     $this->assertEquals('*****@*****.**', $extension->getEmail());
     $this->assertEquals(md5('*****@*****.**'), $extension->getEmailID());
     $this->assertEquals('http://www.dokuwiki.org/template:dokuwiki', $extension->getURL());
     $this->assertEquals('DokuWiki\'s default template since 2012', $extension->getDescription());
     $this->assertTrue($extension->isTemplate());
     $this->assertTrue($extension->isEnabled());
     $this->assertTrue($extension->isInstalled());
     $this->assertTrue($extension->isBundled());
 }
Ejemplo n.º 2
0
 /**
  * Generate a link to the author of the extension
  *
  * @param helper_plugin_extension_extension $extension The extension object
  * @return string The HTML code of the link
  */
 function make_author(helper_plugin_extension_extension $extension)
 {
     global $ID;
     if ($extension->getAuthor()) {
         $mailid = $extension->getEmailID();
         if ($mailid) {
             $url = $this->gui->tabURL('search', array('q' => 'authorid:' . $mailid));
             return '<bdi><a href="' . $url . '" class="author" title="' . $this->getLang('author_hint') . '" ><img src="//www.gravatar.com/avatar/' . $mailid . '?s=20&amp;d=mm" width="20" height="20" alt="" /> ' . hsc($extension->getAuthor()) . '</a></bdi>';
         } else {
             return '<bdi><span class="author">' . hsc($extension->getAuthor()) . '</span></bdi>';
         }
     }
     return "<em class=\"author\">" . $this->getLang('unknown_author') . "</em>" . DOKU_LF;
 }