summaryrefslogtreecommitdiff
path: root/lib/plugins/styler/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-16 18:40:21 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-16 18:40:21 +0200
commit6ea007c9f8c6830ea4f21ad880e91279e2f4bf10 (patch)
tree8d769608fe260066773457feccb987730459a73e /lib/plugins/styler/_test
parent4d6524b8916955bf5fa9086042917244751dc03d (diff)
downloadrpg-6ea007c9f8c6830ea4f21ad880e91279e2f4bf10.tar.gz
rpg-6ea007c9f8c6830ea4f21ad880e91279e2f4bf10.tar.bz2
a first very basic implementation of the preview mechanism
Diffstat (limited to 'lib/plugins/styler/_test')
-rw-r--r--lib/plugins/styler/_test/general.test.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/plugins/styler/_test/general.test.php b/lib/plugins/styler/_test/general.test.php
new file mode 100644
index 000000000..8b0712a20
--- /dev/null
+++ b/lib/plugins/styler/_test/general.test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * General tests for the styler plugin
+ *
+ * @group plugin_styler
+ * @group plugins
+ */
+class general_plugin_styler_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('styler', $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']));
+ }
+}