summaryrefslogtreecommitdiff
path: root/_test/tests/inc/template_include_page.test.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-06-26 11:07:20 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-06-26 11:07:20 +0200
commit5ddba4576a304c9e62b028c97ee466d79de12429 (patch)
tree03199c579f9302f0ed1e0b47f9c597a7f9bd2fc7 /_test/tests/inc/template_include_page.test.php
parent5114259bf530b89afbb21bd693b1da3f96016b7f (diff)
parent71c46303d9cd8a321e58a7e7255d13f0d5a5c4eb (diff)
downloadrpg-5ddba4576a304c9e62b028c97ee466d79de12429.tar.gz
rpg-5ddba4576a304c9e62b028c97ee466d79de12429.tar.bz2
Merge branch 'master' into styler
* master: (26 commits) translation update translation update Replace old constructor call by __construct() in dokuwiki_xmlrpc_server translation update change two spaces to a space translation update translation update translation update translation update Upgrade to jQuery 1.11.3 and jQueryUI 1.11.4 closes #1175 update confToHash() inline documentation for new parameter translation update Plugins can send usage data fixed isBundled() check when remote info is unavailable avoid accessing nonexistant array key. fixes #1165 translation update Define the negation character in a constant Ensure single value negation is not affected by white space differences Ensure filtering only removes empty string values (not other values which PHP evaluates to false) translation update ...
Diffstat (limited to '_test/tests/inc/template_include_page.test.php')
-rw-r--r--_test/tests/inc/template_include_page.test.php77
1 files changed, 52 insertions, 25 deletions
diff --git a/_test/tests/inc/template_include_page.test.php b/_test/tests/inc/template_include_page.test.php
index 47d4d46f1..7dd13ba23 100644
--- a/_test/tests/inc/template_include_page.test.php
+++ b/_test/tests/inc/template_include_page.test.php
@@ -1,40 +1,67 @@
<?php
-class template_include_page_test extends DokuWikiTest {
- function testNoSidebar() {
- global $ID;
+class template_pagetitle_test extends DokuWikiTest {
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertEquals('', $sidebar);
+ function test_localID() {
+ global $ID,$ACT;
+
+
+ $id = 'foo:bar';
+
+ $ACT = 'show';
+ $this->assertEquals('foo:bar', tpl_pagetitle($id, true));
}
- function testExistingSidebars() {
- global $ID;
+ function test_globalID() {
+ global $ID,$ACT;
+
- saveWikiText('sidebar', 'topsidebar-test', '');
+ $ID = 'foo:bar';
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $ACT = 'show';
+ $this->assertEquals('foo:bar', tpl_pagetitle(null, true));
+ }
+
+ function test_adminTitle() {
+ global $ID,$ACT;
- $ID = 'foo';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $ID = 'foo:bar';
+
+ $ACT = 'admin';
+ $this->assertEquals('Admin', tpl_pagetitle(null, true));
+ }
- saveWikiText('foo:bar:sidebar', 'bottomsidebar-test', '');
+ function test_adminPluginTitle() {
+ global $ID,$ACT,$INPUT,$conf;
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'bottomsidebar-test') > 0);
+ if (!plugin_load('admin','revert')) {
+ $this->markTestSkipped('Revert plugin not found, unable to test admin plugin titles');
+ return;
+ }
- $ID = 'foo:bar:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'bottomsidebar-test') > 0);
+ $ID = 'foo:bar';
+ $ACT = 'admin';
+ $conf['lang'] = 'en';
+ $INPUT->set('page','revert');
- $ID = 'foo';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $this->assertEquals('Revert Manager', tpl_pagetitle(null, true));
}
+ function test_nonPageFunctionTitle() {
+ global $ID,$ACT;
+
+ $ID = 'foo:bar';
+
+ $ACT = 'index';
+ $this->assertEquals('Sitemap', tpl_pagetitle(null, true));
+ }
+
+ function test_pageFunctionTitle() {
+ global $ID,$ACT;
+
+ $ID = 'foo:bar';
+
+ $ACT = 'revisions';
+ $this->assertEquals('foo:bar - Old revisions', tpl_pagetitle(null, true));
+ }
}