Added test

This commit is contained in:
Giuseppe Di Terlizzi 2015-03-28 03:07:42 +01:00
parent 0c13153d8e
commit d39718e514
3 changed files with 48 additions and 1 deletions

12
.travis.yml Normal file
View file

@ -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

35
_test/general.test.php Normal file
View file

@ -0,0 +1,35 @@
<?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('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']));
}
}

View file

@ -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