general.test.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * General tests for the icons plugin
  4. *
  5. * @group plugin_icons
  6. * @group plugins
  7. */
  8. class general_plugin_icons_test extends DokuWikiTest {
  9. /**
  10. * Simple test to make sure the plugin.info.txt is in correct format
  11. */
  12. public function test_plugininfo() {
  13. $file = __DIR__.'/../plugin.info.txt';
  14. $this->assertFileExists($file);
  15. $info = confToHash($file);
  16. $this->assertArrayHasKey('base', $info);
  17. $this->assertArrayHasKey('author', $info);
  18. $this->assertArrayHasKey('email', $info);
  19. $this->assertArrayHasKey('date', $info);
  20. $this->assertArrayHasKey('name', $info);
  21. $this->assertArrayHasKey('desc', $info);
  22. $this->assertArrayHasKey('url', $info);
  23. $this->assertEquals('icons', $info['base']);
  24. $this->assertRegExp('/^https?:\/\//', $info['url']);
  25. $this->assertTrue(mail_isvalid($info['email']));
  26. $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
  27. $this->assertTrue(false !== strtotime($info['date']));
  28. }
  29. }