112d9bd9eSMichael Hamann<?php 212d9bd9eSMichael Hamann 312d9bd9eSMichael Hamann/** 4*9d6a86f3SAndreas Gohr * Tests the move support for adapting the syntax of the include plugin 5c76c7b12SAndreas Gohr * 6c76c7b12SAndreas Gohr * @group plugin_include 7c76c7b12SAndreas Gohr * @group plugins 812d9bd9eSMichael Hamann */ 912d9bd9eSMichael Hamannclass plugin_include_pagemove_support_test extends DokuWikiTest { 1012d9bd9eSMichael Hamann public function setup() { 11306441b3SMichael Hamann $this->pluginsEnabled[] = 'move'; 1212d9bd9eSMichael Hamann $this->pluginsEnabled[] = 'include'; 1312d9bd9eSMichael Hamann parent::setup(); 1412d9bd9eSMichael Hamann } 1512d9bd9eSMichael Hamann 1612d9bd9eSMichael Hamann public function test_relative_include() { 1783d8beadSMichael Hamann /** @var $move helper_plugin_move_op */ 1883d8beadSMichael Hamann $move = plugin_load('helper', 'move_op'); 19*9d6a86f3SAndreas Gohr if (!$move) { 20*9d6a86f3SAndreas Gohr $this->markTestSkipped('the move plugin is not installed'); 21*9d6a86f3SAndreas Gohr return; 22*9d6a86f3SAndreas Gohr } 2312d9bd9eSMichael Hamann saveWikiText('editx', '{{page>start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}', 'Testcase created'); 2412d9bd9eSMichael Hamann idx_addPage('editx'); 2583d8beadSMichael Hamann $this->assertTrue($move->movePage('editx', 'test:editx')); 2612d9bd9eSMichael Hamann $this->assertEquals('{{page>:start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}',rawWiki('test:editx')); 2712d9bd9eSMichael Hamann } 2812d9bd9eSMichael Hamann 2912d9bd9eSMichael Hamann public function test_rename() { 3083d8beadSMichael Hamann /** @var $move helper_plugin_move_op */ 3183d8beadSMichael Hamann $move = plugin_load('helper', 'move_op'); 32*9d6a86f3SAndreas Gohr if (!$move) { 33*9d6a86f3SAndreas Gohr $this->markTestSkipped('the move plugin is not installed'); 34*9d6a86f3SAndreas Gohr return; 35*9d6a86f3SAndreas Gohr } 3612d9bd9eSMichael Hamann saveWikiText('editx', 'Page to rename', 'Testcase create'); 3712d9bd9eSMichael Hamann saveWikiText('links', '{{section>links#foo}} {{page>editx}} {{page>:eDitX&nofooter}} {{section>editx#test}} {{page>editx&nofooter}}', 'Testcase created'); 3812d9bd9eSMichael Hamann idx_addPage('editx'); 3912d9bd9eSMichael Hamann idx_addPage('links'); 4012d9bd9eSMichael Hamann 4183d8beadSMichael Hamann $this->assertTrue($move->movePage('editx', 'test:edit')); 4212d9bd9eSMichael Hamann $this->assertEquals('{{section>links#foo}} {{page>test:edit}} {{page>test:edit&nofooter}} {{section>test:edit#test}} {{page>test:edit&nofooter}}', rawWiki('links')); 4312d9bd9eSMichael Hamann } 4412d9bd9eSMichael Hamann} 45