Skip to content

Commit

Permalink
Merge pull request #1 from mprins/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
mprins authored Sep 11, 2016
2 parents 7d1945d + 6169df3 commit f202bfb
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 298 deletions.
62 changes: 31 additions & 31 deletions _test/general.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,40 @@
*/
class general_plugin_spatialhelper_test extends DokuWikiTest {

protected $pluginsEnabled = array('spatialhelper');
protected $pluginsEnabled = array('spatialhelper');

/**
* 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);
/**
* 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);
$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->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('spatialhelper', $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']));
}
$this->assertEquals('spatialhelper', $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']));
}

/**
* test if plugin is loaded.
*/
public function test_plugin_spatialhelper_isloaded() {
global $plugin_controller;
$this->assertTrue(
in_array('spatialhelper', $plugin_controller->getList()),
"spatialhelper plugin is loaded"
);
}
/**
* test if plugin is loaded.
*/
public function test_plugin_spatialhelper_isloaded() {
global $plugin_controller;
$this->assertTrue(
in_array('spatialhelper', $plugin_controller->getList()),
"spatialhelper plugin is loaded"
);
}
}
Loading

0 comments on commit f202bfb

Please sign in to comment.