2015-03-28 02:07:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* General tests for the semantic plugin
|
|
|
|
*
|
|
|
|
* @group plugin_semantic
|
|
|
|
* @group plugins
|
|
|
|
*/
|
2020-08-25 10:13:34 +00:00
|
|
|
class general_plugin_semantic_test extends DokuWikiTest
|
|
|
|
{
|
2015-03-28 02:07:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Simple test to make sure the plugin.info.txt is in correct format
|
|
|
|
*/
|
2020-08-25 10:13:34 +00:00
|
|
|
public function test_plugininfo()
|
|
|
|
{
|
|
|
|
$file = __DIR__ . '/../plugin.info.txt';
|
2015-03-28 02:07:42 +00:00
|
|
|
$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);
|
|
|
|
|
2015-03-28 14:33:59 +00:00
|
|
|
$this->assertEquals('semantic', $info['base']);
|
2015-03-28 02:07:42 +00:00
|
|
|
$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']));
|
|
|
|
}
|
|
|
|
}
|