Cleanup: explicit method visibility
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
parent
724f1e3229
commit
93b1fe54fb
16 changed files with 65 additions and 69 deletions
|
@ -25,7 +25,7 @@ class PageBuilder
|
||||||
*
|
*
|
||||||
* @param ConfigManager $conf Configuration Manager instance (reference).
|
* @param ConfigManager $conf Configuration Manager instance (reference).
|
||||||
*/
|
*/
|
||||||
function __construct(&$conf)
|
public function __construct(&$conf)
|
||||||
{
|
{
|
||||||
$this->tpl = false;
|
$this->tpl = false;
|
||||||
$this->conf = $conf;
|
$this->conf = $conf;
|
||||||
|
|
|
@ -14,7 +14,7 @@ interface ConfigIO
|
||||||
*
|
*
|
||||||
* @return array All configuration in an array.
|
* @return array All configuration in an array.
|
||||||
*/
|
*/
|
||||||
function read($filepath);
|
public function read($filepath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write configuration.
|
* Write configuration.
|
||||||
|
@ -22,12 +22,12 @@ function read($filepath);
|
||||||
* @param string $filepath Config file absolute path.
|
* @param string $filepath Config file absolute path.
|
||||||
* @param array $conf All configuration in an array.
|
* @param array $conf All configuration in an array.
|
||||||
*/
|
*/
|
||||||
function write($filepath, $conf);
|
public function write($filepath, $conf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get config file extension according to config type.
|
* Get config file extension according to config type.
|
||||||
*
|
*
|
||||||
* @return string Config file extension.
|
* @return string Config file extension.
|
||||||
*/
|
*/
|
||||||
function getExtension();
|
public function getExtension();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ class ConfigJson implements ConfigIO
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function read($filepath)
|
public function read($filepath)
|
||||||
{
|
{
|
||||||
if (! is_readable($filepath)) {
|
if (! is_readable($filepath)) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -29,7 +29,7 @@ function read($filepath)
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function write($filepath, $conf)
|
public function write($filepath, $conf)
|
||||||
{
|
{
|
||||||
// JSON_PRETTY_PRINT is available from PHP 5.4.
|
// JSON_PRETTY_PRINT is available from PHP 5.4.
|
||||||
$print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
|
$print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
|
||||||
|
@ -46,7 +46,7 @@ function write($filepath, $conf)
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function getExtension()
|
public function getExtension()
|
||||||
{
|
{
|
||||||
return '.json.php';
|
return '.json.php';
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class ConfigPhp implements ConfigIO
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function read($filepath)
|
public function read($filepath)
|
||||||
{
|
{
|
||||||
if (! file_exists($filepath) || ! is_readable($filepath)) {
|
if (! file_exists($filepath) || ! is_readable($filepath)) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -91,7 +91,7 @@ function read($filepath)
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function write($filepath, $conf)
|
public function write($filepath, $conf)
|
||||||
{
|
{
|
||||||
$configStr = '<?php '. PHP_EOL;
|
$configStr = '<?php '. PHP_EOL;
|
||||||
foreach (self::$ROOT_KEYS as $key) {
|
foreach (self::$ROOT_KEYS as $key) {
|
||||||
|
@ -125,7 +125,7 @@ function write($filepath, $conf)
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
function getExtension()
|
public function getExtension()
|
||||||
{
|
{
|
||||||
return '.php';
|
return '.php';
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class WallabagInstance
|
||||||
*/
|
*/
|
||||||
private $apiVersion;
|
private $apiVersion;
|
||||||
|
|
||||||
function __construct($instance, $version)
|
public function __construct($instance, $version)
|
||||||
{
|
{
|
||||||
if ($this->isVersionAllowed($version)) {
|
if ($this->isVersionAllowed($version)) {
|
||||||
$this->apiVersion = self::$wallabagVersions[$version];
|
$this->apiVersion = self::$wallabagVersions[$version];
|
||||||
|
|
|
@ -157,7 +157,7 @@ public function testDefaultScheme() {
|
||||||
/**
|
/**
|
||||||
* Test add trailing slash.
|
* Test add trailing slash.
|
||||||
*/
|
*/
|
||||||
function testAddTrailingSlash()
|
public function testAddTrailingSlash()
|
||||||
{
|
{
|
||||||
$strOn = 'http://randomstr.com/test/';
|
$strOn = 'http://randomstr.com/test/';
|
||||||
$strOff = 'http://randomstr.com/test';
|
$strOff = 'http://randomstr.com/test';
|
||||||
|
@ -168,7 +168,7 @@ function testAddTrailingSlash()
|
||||||
/**
|
/**
|
||||||
* Test valid HTTP url.
|
* Test valid HTTP url.
|
||||||
*/
|
*/
|
||||||
function testUrlIsHttp()
|
public function testUrlIsHttp()
|
||||||
{
|
{
|
||||||
$url = new Url(self::$baseUrl);
|
$url = new Url(self::$baseUrl);
|
||||||
$this->assertTrue($url->isHttp());
|
$this->assertTrue($url->isHttp());
|
||||||
|
@ -177,7 +177,7 @@ function testUrlIsHttp()
|
||||||
/**
|
/**
|
||||||
* Test non HTTP url.
|
* Test non HTTP url.
|
||||||
*/
|
*/
|
||||||
function testUrlIsNotHttp()
|
public function testUrlIsNotHttp()
|
||||||
{
|
{
|
||||||
$url = new Url('ftp://save.tld/mysave');
|
$url = new Url('ftp://save.tld/mysave');
|
||||||
$this->assertFalse($url->isHttp());
|
$this->assertFalse($url->isHttp());
|
||||||
|
@ -186,7 +186,7 @@ function testUrlIsNotHttp()
|
||||||
/**
|
/**
|
||||||
* Test International Domain Name to ASCII conversion
|
* Test International Domain Name to ASCII conversion
|
||||||
*/
|
*/
|
||||||
function testIdnToAscii()
|
public function testIdnToAscii()
|
||||||
{
|
{
|
||||||
$ind = 'http://www.académie-française.fr/';
|
$ind = 'http://www.académie-française.fr/';
|
||||||
$expected = 'http://www.xn--acadmie-franaise-npb1a.fr/';
|
$expected = 'http://www.xn--acadmie-franaise-npb1a.fr/';
|
||||||
|
|
|
@ -16,7 +16,7 @@ class PluginAddlinkTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path.
|
* Reset plugin path.
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test render_header hook while logged in.
|
* Test render_header hook while logged in.
|
||||||
*/
|
*/
|
||||||
function testAddlinkHeaderLoggedIn()
|
public function testAddlinkHeaderLoggedIn()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
@ -46,7 +46,7 @@ function testAddlinkHeaderLoggedIn()
|
||||||
/**
|
/**
|
||||||
* Test render_header hook while logged out.
|
* Test render_header hook while logged out.
|
||||||
*/
|
*/
|
||||||
function testAddlinkHeaderLoggedOut()
|
public function testAddlinkHeaderLoggedOut()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
@ -61,7 +61,7 @@ function testAddlinkHeaderLoggedOut()
|
||||||
/**
|
/**
|
||||||
* Test render_includes hook while logged in.
|
* Test render_includes hook while logged in.
|
||||||
*/
|
*/
|
||||||
function testAddlinkIncludesLoggedIn()
|
public function testAddlinkIncludesLoggedIn()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
@ -86,7 +86,7 @@ function testAddlinkIncludesLoggedIn()
|
||||||
* Test render_includes hook.
|
* Test render_includes hook.
|
||||||
* Should not affect css files while logged out.
|
* Should not affect css files while logged out.
|
||||||
*/
|
*/
|
||||||
function testAddlinkIncludesLoggedOut()
|
public function testAddlinkIncludesLoggedOut()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
|
|
@ -15,7 +15,7 @@ class PluginArchiveorgTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook on external links.
|
* Test render_linklist hook on external links.
|
||||||
*/
|
*/
|
||||||
function testArchiveorgLinklistOnExternalLinks()
|
public function testArchiveorgLinklistOnExternalLinks()
|
||||||
{
|
{
|
||||||
$str = 'http://randomstr.com/test';
|
$str = 'http://randomstr.com/test';
|
||||||
|
|
||||||
|
@ -48,13 +48,12 @@ function testArchiveorgLinklistOnExternalLinks()
|
||||||
// plugin data
|
// plugin data
|
||||||
$this->assertEquals(1, count($link['link_plugin']));
|
$this->assertEquals(1, count($link['link_plugin']));
|
||||||
$this->assertNotFalse(strpos($link['link_plugin'][0], $str));
|
$this->assertNotFalse(strpos($link['link_plugin'][0], $str));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook on internal links.
|
* Test render_linklist hook on internal links.
|
||||||
*/
|
*/
|
||||||
function testArchiveorgLinklistOnInternalLinks()
|
public function testArchiveorgLinklistOnInternalLinks()
|
||||||
{
|
{
|
||||||
$internalLink1 = 'http://shaarli.shaarli/?qvMAqg';
|
$internalLink1 = 'http://shaarli.shaarli/?qvMAqg';
|
||||||
$internalLinkRealURL1 = '?qvMAqg';
|
$internalLinkRealURL1 = '?qvMAqg';
|
||||||
|
@ -101,7 +100,6 @@ function testArchiveorgLinklistOnInternalLinks()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$data = hook_archiveorg_render_linklist($data);
|
$data = hook_archiveorg_render_linklist($data);
|
||||||
|
|
||||||
// Case n°1: first link type, public
|
// Case n°1: first link type, public
|
||||||
|
@ -136,7 +134,5 @@ function testArchiveorgLinklistOnInternalLinks()
|
||||||
$link = $data['links'][5];
|
$link = $data['links'][5];
|
||||||
|
|
||||||
$this->assertArrayNotHasKey('link_plugin', $link);
|
$this->assertArrayNotHasKey('link_plugin', $link);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test Isso init without errors.
|
* Test Isso init without errors.
|
||||||
*/
|
*/
|
||||||
function testWallabagInitNoError()
|
public function testWallabagInitNoError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.ISSO_SERVER', 'value');
|
$conf->set('plugins.ISSO_SERVER', 'value');
|
||||||
|
@ -31,7 +31,7 @@ function testWallabagInitNoError()
|
||||||
/**
|
/**
|
||||||
* Test Isso init with errors.
|
* Test Isso init with errors.
|
||||||
*/
|
*/
|
||||||
function testWallabagInitError()
|
public function testWallabagInitError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$errors = isso_init($conf);
|
$errors = isso_init($conf);
|
||||||
|
@ -41,7 +41,7 @@ function testWallabagInitError()
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook with valid settings to display the comment form.
|
* Test render_linklist hook with valid settings to display the comment form.
|
||||||
*/
|
*/
|
||||||
function testIssoDisplayed()
|
public function testIssoDisplayed()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.ISSO_SERVER', 'value');
|
$conf->set('plugins.ISSO_SERVER', 'value');
|
||||||
|
@ -81,7 +81,7 @@ function testIssoDisplayed()
|
||||||
/**
|
/**
|
||||||
* Test isso plugin when multiple links are displayed (shouldn't be displayed).
|
* Test isso plugin when multiple links are displayed (shouldn't be displayed).
|
||||||
*/
|
*/
|
||||||
function testIssoMultipleLinks()
|
public function testIssoMultipleLinks()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.ISSO_SERVER', 'value');
|
$conf->set('plugins.ISSO_SERVER', 'value');
|
||||||
|
@ -113,7 +113,7 @@ function testIssoMultipleLinks()
|
||||||
/**
|
/**
|
||||||
* Test isso plugin when using search (shouldn't be displayed).
|
* Test isso plugin when using search (shouldn't be displayed).
|
||||||
*/
|
*/
|
||||||
function testIssoNotDisplayedWhenSearch()
|
public function testIssoNotDisplayedWhenSearch()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.ISSO_SERVER', 'value');
|
$conf->set('plugins.ISSO_SERVER', 'value');
|
||||||
|
@ -141,7 +141,7 @@ function testIssoNotDisplayedWhenSearch()
|
||||||
/**
|
/**
|
||||||
* Test isso plugin without server configuration (shouldn't be displayed).
|
* Test isso plugin without server configuration (shouldn't be displayed).
|
||||||
*/
|
*/
|
||||||
function testIssoWithoutConf()
|
public function testIssoWithoutConf()
|
||||||
{
|
{
|
||||||
$data = 'abc';
|
$data = 'abc';
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
|
|
|
@ -16,7 +16,7 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ function setUp()
|
||||||
* Test render_linklist hook.
|
* Test render_linklist hook.
|
||||||
* Only check that there is basic markdown rendering.
|
* Only check that there is basic markdown rendering.
|
||||||
*/
|
*/
|
||||||
function testMarkdownLinklist()
|
public function testMarkdownLinklist()
|
||||||
{
|
{
|
||||||
$markdown = '# My title' . PHP_EOL . 'Very interesting content.';
|
$markdown = '# My title' . PHP_EOL . 'Very interesting content.';
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -45,7 +45,7 @@ function testMarkdownLinklist()
|
||||||
* Test render_daily hook.
|
* Test render_daily hook.
|
||||||
* Only check that there is basic markdown rendering.
|
* Only check that there is basic markdown rendering.
|
||||||
*/
|
*/
|
||||||
function testMarkdownDaily()
|
public function testMarkdownDaily()
|
||||||
{
|
{
|
||||||
$markdown = '# My title' . PHP_EOL . 'Very interesting content.';
|
$markdown = '# My title' . PHP_EOL . 'Very interesting content.';
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -69,7 +69,7 @@ function testMarkdownDaily()
|
||||||
/**
|
/**
|
||||||
* Test reverse_text2clickable().
|
* Test reverse_text2clickable().
|
||||||
*/
|
*/
|
||||||
function testReverseText2clickable()
|
public function testReverseText2clickable()
|
||||||
{
|
{
|
||||||
$text = 'stuff http://hello.there/is=someone#here otherstuff';
|
$text = 'stuff http://hello.there/is=someone#here otherstuff';
|
||||||
$clickableText = text2clickable($text, '');
|
$clickableText = text2clickable($text, '');
|
||||||
|
@ -80,7 +80,7 @@ function testReverseText2clickable()
|
||||||
/**
|
/**
|
||||||
* Test reverse_nl2br().
|
* Test reverse_nl2br().
|
||||||
*/
|
*/
|
||||||
function testReverseNl2br()
|
public function testReverseNl2br()
|
||||||
{
|
{
|
||||||
$text = 'stuff' . PHP_EOL . 'otherstuff';
|
$text = 'stuff' . PHP_EOL . 'otherstuff';
|
||||||
$processedText = nl2br($text);
|
$processedText = nl2br($text);
|
||||||
|
@ -91,7 +91,7 @@ function testReverseNl2br()
|
||||||
/**
|
/**
|
||||||
* Test reverse_space2nbsp().
|
* Test reverse_space2nbsp().
|
||||||
*/
|
*/
|
||||||
function testReverseSpace2nbsp()
|
public function testReverseSpace2nbsp()
|
||||||
{
|
{
|
||||||
$text = ' stuff' . PHP_EOL . ' otherstuff and another';
|
$text = ' stuff' . PHP_EOL . ' otherstuff and another';
|
||||||
$processedText = space2nbsp($text);
|
$processedText = space2nbsp($text);
|
||||||
|
@ -102,7 +102,7 @@ function testReverseSpace2nbsp()
|
||||||
/**
|
/**
|
||||||
* Test sanitize_html().
|
* Test sanitize_html().
|
||||||
*/
|
*/
|
||||||
function testSanitizeHtml()
|
public function testSanitizeHtml()
|
||||||
{
|
{
|
||||||
$input = '< script src="js.js"/>';
|
$input = '< script src="js.js"/>';
|
||||||
$input .= '< script attr>alert(\'xss\');</script>';
|
$input .= '< script attr>alert(\'xss\');</script>';
|
||||||
|
@ -119,7 +119,7 @@ function testSanitizeHtml()
|
||||||
/**
|
/**
|
||||||
* Test the no markdown tag.
|
* Test the no markdown tag.
|
||||||
*/
|
*/
|
||||||
function testNoMarkdownTag()
|
public function testNoMarkdownTag()
|
||||||
{
|
{
|
||||||
$str = 'All _work_ and `no play` makes Jack a *dull* boy.';
|
$str = 'All _work_ and `no play` makes Jack a *dull* boy.';
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -158,7 +158,7 @@ function testNoMarkdownTag()
|
||||||
/**
|
/**
|
||||||
* Test that a close value to nomarkdown is not understand as nomarkdown (previous value `.nomarkdown`).
|
* Test that a close value to nomarkdown is not understand as nomarkdown (previous value `.nomarkdown`).
|
||||||
*/
|
*/
|
||||||
function testNoMarkdownNotExcactlyMatching()
|
public function testNoMarkdownNotExcactlyMatching()
|
||||||
{
|
{
|
||||||
$str = 'All _work_ and `no play` makes Jack a *dull* boy.';
|
$str = 'All _work_ and `no play` makes Jack a *dull* boy.';
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -176,7 +176,7 @@ function testNoMarkdownNotExcactlyMatching()
|
||||||
/**
|
/**
|
||||||
* Test hashtag links processed with markdown.
|
* Test hashtag links processed with markdown.
|
||||||
*/
|
*/
|
||||||
function testMarkdownHashtagLinks()
|
public function testMarkdownHashtagLinks()
|
||||||
{
|
{
|
||||||
$md = file_get_contents('tests/plugins/resources/markdown.md');
|
$md = file_get_contents('tests/plugins/resources/markdown.md');
|
||||||
$md = format_description($md);
|
$md = format_description($md);
|
||||||
|
|
|
@ -16,7 +16,7 @@ class PluginPlayvideosTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook.
|
* Test render_linklist hook.
|
||||||
*/
|
*/
|
||||||
function testPlayvideosHeader()
|
public function testPlayvideosHeader()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
@ -43,7 +43,7 @@ function testPlayvideosHeader()
|
||||||
/**
|
/**
|
||||||
* Test render_footer hook.
|
* Test render_footer hook.
|
||||||
*/
|
*/
|
||||||
function testPlayvideosFooter()
|
public function testPlayvideosFooter()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
||||||
|
|
|
@ -17,7 +17,7 @@ class PluginPubsubhubbubTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test render_feed hook with an RSS feed.
|
* Test render_feed hook with an RSS feed.
|
||||||
*/
|
*/
|
||||||
function testPubSubRssRenderFeed()
|
public function testPubSubRssRenderFeed()
|
||||||
{
|
{
|
||||||
$hub = 'http://domain.hub';
|
$hub = 'http://domain.hub';
|
||||||
$conf = new ConfigManager(self::$configFile);
|
$conf = new ConfigManager(self::$configFile);
|
||||||
|
@ -40,7 +40,7 @@ function testPubSubRssRenderFeed()
|
||||||
/**
|
/**
|
||||||
* Test render_feed hook with an ATOM feed.
|
* Test render_feed hook with an ATOM feed.
|
||||||
*/
|
*/
|
||||||
function testPubSubAtomRenderFeed()
|
public function testPubSubAtomRenderFeed()
|
||||||
{
|
{
|
||||||
$hub = 'http://domain.hub';
|
$hub = 'http://domain.hub';
|
||||||
$conf = new ConfigManager(self::$configFile);
|
$conf = new ConfigManager(self::$configFile);
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlugQrcodeTest.php
|
* PluginQrcodeTest.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'plugins/qrcode/qrcode.php';
|
require_once 'plugins/qrcode/qrcode.php';
|
||||||
require_once 'application/Router.php';
|
require_once 'application/Router.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PlugQrcodeTest
|
* Class PluginQrcodeTest
|
||||||
* Unit test for the QR-Code plugin
|
* Unit test for the QR-Code plugin
|
||||||
*/
|
*/
|
||||||
class PlugQrcodeTest extends PHPUnit_Framework_TestCase
|
class PluginQrcodeTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp() {
|
public function setUp() {
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook.
|
* Test render_linklist hook.
|
||||||
*/
|
*/
|
||||||
function testQrcodeLinklist()
|
public function testQrcodeLinklist()
|
||||||
{
|
{
|
||||||
$str = 'http://randomstr.com/test';
|
$str = 'http://randomstr.com/test';
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -49,7 +49,7 @@ function testQrcodeLinklist()
|
||||||
/**
|
/**
|
||||||
* Test render_footer hook.
|
* Test render_footer hook.
|
||||||
*/
|
*/
|
||||||
function testQrcodeFooter()
|
public function testQrcodeFooter()
|
||||||
{
|
{
|
||||||
$str = 'stuff';
|
$str = 'stuff';
|
||||||
$data = array($str => $str);
|
$data = array($str => $str);
|
|
@ -15,7 +15,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test Readityourself init without errors.
|
* Test Readityourself init without errors.
|
||||||
*/
|
*/
|
||||||
function testReadityourselfInitNoError()
|
public function testReadityourselfInitNoError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.READITYOUSELF_URL', 'value');
|
$conf->set('plugins.READITYOUSELF_URL', 'value');
|
||||||
|
@ -34,7 +34,7 @@ function testReadityourselfInitNoError()
|
||||||
/**
|
/**
|
||||||
* Test Readityourself init with errors.
|
* Test Readityourself init with errors.
|
||||||
*/
|
*/
|
||||||
function testReadityourselfInitError()
|
public function testReadityourselfInitError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$errors = readityourself_init($conf);
|
$errors = readityourself_init($conf);
|
||||||
|
@ -44,7 +44,7 @@ function testReadityourselfInitError()
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook.
|
* Test render_linklist hook.
|
||||||
*/
|
*/
|
||||||
function testReadityourselfLinklist()
|
public function testReadityourselfLinklist()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.READITYOUSELF_URL', 'value');
|
$conf->set('plugins.READITYOUSELF_URL', 'value');
|
||||||
|
@ -72,7 +72,7 @@ function testReadityourselfLinklist()
|
||||||
/**
|
/**
|
||||||
* Test without config: nothing should happened.
|
* Test without config: nothing should happened.
|
||||||
*/
|
*/
|
||||||
function testReadityourselfLinklistWithoutConfig()
|
public function testReadityourselfLinklistWithoutConfig()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.READITYOUSELF_URL', null);
|
$conf->set('plugins.READITYOUSELF_URL', null);
|
||||||
|
|
|
@ -15,7 +15,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
PluginManager::$PLUGINS_PATH = 'plugins';
|
PluginManager::$PLUGINS_PATH = 'plugins';
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test wallabag init without errors.
|
* Test wallabag init without errors.
|
||||||
*/
|
*/
|
||||||
function testWallabagInitNoError()
|
public function testWallabagInitNoError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.WALLABAG_URL', 'value');
|
$conf->set('plugins.WALLABAG_URL', 'value');
|
||||||
|
@ -34,7 +34,7 @@ function testWallabagInitNoError()
|
||||||
/**
|
/**
|
||||||
* Test wallabag init with errors.
|
* Test wallabag init with errors.
|
||||||
*/
|
*/
|
||||||
function testWallabagInitError()
|
public function testWallabagInitError()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$errors = wallabag_init($conf);
|
$errors = wallabag_init($conf);
|
||||||
|
@ -44,7 +44,7 @@ function testWallabagInitError()
|
||||||
/**
|
/**
|
||||||
* Test render_linklist hook.
|
* Test render_linklist hook.
|
||||||
*/
|
*/
|
||||||
function testWallabagLinklist()
|
public function testWallabagLinklist()
|
||||||
{
|
{
|
||||||
$conf = new ConfigManager('');
|
$conf = new ConfigManager('');
|
||||||
$conf->set('plugins.WALLABAG_URL', 'value');
|
$conf->set('plugins.WALLABAG_URL', 'value');
|
||||||
|
|
|
@ -15,7 +15,7 @@ class WallabagInstanceTest extends PHPUnit_Framework_TestCase
|
||||||
/**
|
/**
|
||||||
* Reset plugin path
|
* Reset plugin path
|
||||||
*/
|
*/
|
||||||
function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
$this->instance = 'http://some.url';
|
$this->instance = 'http://some.url';
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function setUp()
|
||||||
/**
|
/**
|
||||||
* Test WallabagInstance with API V1.
|
* Test WallabagInstance with API V1.
|
||||||
*/
|
*/
|
||||||
function testWallabagInstanceV1()
|
public function testWallabagInstanceV1()
|
||||||
{
|
{
|
||||||
$instance = new WallabagInstance($this->instance, 1);
|
$instance = new WallabagInstance($this->instance, 1);
|
||||||
$expected = $this->instance . '/?plainurl=';
|
$expected = $this->instance . '/?plainurl=';
|
||||||
|
@ -34,7 +34,7 @@ function testWallabagInstanceV1()
|
||||||
/**
|
/**
|
||||||
* Test WallabagInstance with API V2.
|
* Test WallabagInstance with API V2.
|
||||||
*/
|
*/
|
||||||
function testWallabagInstanceV2()
|
public function testWallabagInstanceV2()
|
||||||
{
|
{
|
||||||
$instance = new WallabagInstance($this->instance, 2);
|
$instance = new WallabagInstance($this->instance, 2);
|
||||||
$expected = $this->instance . '/bookmarklet?url=';
|
$expected = $this->instance . '/bookmarklet?url=';
|
||||||
|
@ -45,7 +45,7 @@ function testWallabagInstanceV2()
|
||||||
/**
|
/**
|
||||||
* Test WallabagInstance with an invalid API version.
|
* Test WallabagInstance with an invalid API version.
|
||||||
*/
|
*/
|
||||||
function testWallabagInstanceInvalidVersion()
|
public function testWallabagInstanceInvalidVersion()
|
||||||
{
|
{
|
||||||
$instance = new WallabagInstance($this->instance, false);
|
$instance = new WallabagInstance($this->instance, false);
|
||||||
$expected = $this->instance . '/?plainurl=';
|
$expected = $this->instance . '/?plainurl=';
|
||||||
|
|
Loading…
Reference in a new issue