From d39718e5144a083401de3196d4fc7330d6b36ed6 Mon Sep 17 00:00:00 2001 From: Giuseppe Di Terlizzi Date: Sat, 28 Mar 2015 03:07:42 +0100 Subject: [PATCH] Added test --- .travis.yml | 12 ++++++++++++ _test/general.test.php | 35 +++++++++++++++++++++++++++++++++++ plugin.info.txt | 2 +- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 _test/general.test.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5158558 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: php +php: + - "5.5" + - "5.4" + - "5.3" +env: + - DOKUWIKI=master + - DOKUWIKI=stable + - DOKUWIKI=old-stable +before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh +install: sh travis.sh +script: cd _test && phpunit --stderr --group plugin_semantic diff --git a/_test/general.test.php b/_test/general.test.php new file mode 100644 index 0000000..60dd3be --- /dev/null +++ b/_test/general.test.php @@ -0,0 +1,35 @@ +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('tpl', $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'])); + } +} + diff --git a/plugin.info.txt b/plugin.info.txt index 38cfdc2..6304763 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base semantic author Giuseppe Di Terlizzi email giuseppe.diterlizzi@gmail.com -date 2015-03-25 +date 2015-03-26 name Semantic Plugin desc Add Semantic Data in Dokuwiki url http://www.dokuwiki.org/plugin:semantic