[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/tests/inc/ -> template_include_page.test.php (source)

   1  <?php
   2  
   3  class template_pagetitle_test extends DokuWikiTest {
   4  
   5      function test_localID() {
   6          global $ID,$ACT;
   7  
   8  
   9          $id = 'foo:bar';
  10  
  11          $ACT = 'show';
  12          $this->assertEquals('foo:bar', tpl_pagetitle($id, true));
  13      }
  14  
  15      function test_globalID() {
  16          global $ID,$ACT;
  17  
  18  
  19          $ID = 'foo:bar';
  20  
  21          $ACT = 'show';
  22          $this->assertEquals('foo:bar', tpl_pagetitle(null, true));
  23      }
  24  
  25      function test_adminTitle() {
  26          global $ID,$ACT;
  27  
  28          $ID = 'foo:bar';
  29  
  30          $ACT = 'admin';
  31          $this->assertEquals('Admin', tpl_pagetitle(null, true));
  32      }
  33  
  34      function test_adminPluginTitle() {
  35          global $ID,$ACT,$INPUT,$conf,$USERINFO;
  36  
  37          if (!plugin_load('admin','revert')) {
  38              $this->markTestSkipped('Revert plugin not found, unable to test admin plugin titles');
  39              return;
  40          }
  41  
  42          $ID = 'foo:bar';
  43          $ACT = 'admin';
  44          $conf['lang'] = 'en';
  45          $INPUT->set('page','revert');
  46  
  47          $INPUT->server->set('REMOTE_USER', 'testuser'); // this user is admin
  48          $this->assertEquals('Revert Manager', tpl_pagetitle(null, true));
  49      }
  50  
  51      function test_nonPageFunctionTitle() {
  52          global $ID,$ACT;
  53  
  54          $ID = 'foo:bar';
  55  
  56          $ACT = 'index';
  57          $this->assertEquals('Sitemap', tpl_pagetitle(null, true));
  58      }
  59  
  60      function test_pageFunctionTitle() {
  61          global $ID,$ACT;
  62  
  63          $ID = 'foo:bar';
  64  
  65          $ACT = 'revisions';
  66          $this->assertEquals('foo:bar - Old revisions', tpl_pagetitle(null, true));
  67      }
  68  }