1<?php 2 3/** 4 * Tests the editx support for adapting the syntax of the include plugin 5 */ 6class plugin_include_pagemove_support_test extends DokuWikiTest { 7 public function setup() { 8 $this->pluginsEnabled[] = 'pagemove'; 9 $this->pluginsEnabled[] = 'include'; 10 parent::setup(); 11 } 12 13 public function test_relative_include() { 14 global $ID; 15 /** @var $pagemove helper_plugin_pagemove */ 16 $pagemove = plugin_load('helper', 'pagemove'); 17 if (!$pagemove) return; // disable the test when pagemove is not installed 18 saveWikiText('editx', '{{page>start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}', 'Testcase created'); 19 idx_addPage('editx'); 20 $ID = 'editx'; 21 $opts['ns'] = ''; 22 $opts['newname'] = 'editx'; 23 $opts['newns'] = 'test'; 24 $pagemove->move_page($opts); 25 $this->assertEquals('{{page>:start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}',rawWiki('test:editx')); 26 } 27 28 public function test_rename() { 29 global $ID; 30 /** @var $pagemove helper_plugin_pagemove */ 31 $pagemove = plugin_load('helper', 'pagemove'); 32 if (!$pagemove) return; // disable the test when pagemove is not installed 33 saveWikiText('editx', 'Page to rename', 'Testcase create'); 34 saveWikiText('links', '{{section>links#foo}} {{page>editx}} {{page>:eDitX&nofooter}} {{section>editx#test}} {{page>editx&nofooter}}', 'Testcase created'); 35 idx_addPage('editx'); 36 idx_addPage('links'); 37 38 $ID = 'editx'; 39 $opts['ns'] = ''; 40 $opts['newname'] = 'edit'; 41 $opts['newns'] = 'test'; 42 $pagemove->move_page($opts); 43 $this->assertEquals('{{section>links#foo}} {{page>test:edit}} {{page>test:edit&nofooter}} {{section>test:edit#test}} {{page>test:edit&nofooter}}', rawWiki('links')); 44 } 45}