dokuwiki-plugin-semantic/_test/general.test.php
Giuseppe Di Terlizzi 4cc8b6a330 Modified test
2015-03-28 15:33:59 +01:00

35 lines
1.1 KiB
PHP

<?php
/**
* General tests for the semantic plugin
*
* @group plugin_semantic
* @group plugins
*/
class general_plugin_semantic_test extends DokuWikiTest {
/**
* Simple test to make sure the plugin.info.txt is in correct format
*/
public function test_plugininfo() {
$file = __DIR__.'/../plugin.info.txt';
$this->assertFileExists($file);
$info = confToHash($file);
$this->assertArrayHasKey('base', $info);
$this->assertArrayHasKey('author', $info);
$this->assertArrayHasKey('email', $info);
$this->assertArrayHasKey('date', $info);
$this->assertArrayHasKey('name', $info);
$this->assertArrayHasKey('desc', $info);
$this->assertArrayHasKey('url', $info);
$this->assertEquals('semantic', $info['base']);
$this->assertRegExp('/^https?:\/\//', $info['url']);
$this->assertTrue(mail_isvalid($info['email']));
$this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
$this->assertTrue(false !== strtotime($info['date']));
}
}