xref: /plugin/siteexport/_test/plugin_siteexport_move.test.php (revision f4998c133c629e1c2e76b096e85068b555bd9a5f)
1*f4998c13SMichael Hamann<?php
2*f4998c13SMichael Hamann
3*f4998c13SMichael Hamann/**
4*f4998c13SMichael Hamann * @group plugin_siteexport
5*f4998c13SMichael Hamann * @group plugins
6*f4998c13SMichael Hamann */
7*f4998c13SMichael Hamannclass SiteexportMoveTest extends DokuWikiTest {
8*f4998c13SMichael Hamann    public function setup() {
9*f4998c13SMichael Hamann        $this->pluginsEnabled[] = 'siteexport';
10*f4998c13SMichael Hamann        $this->pluginsEnabled[] = 'move';
11*f4998c13SMichael Hamann        parent::setup();
12*f4998c13SMichael Hamann    }
13*f4998c13SMichael Hamann
14*f4998c13SMichael Hamann    public function test_move() {
15*f4998c13SMichael Hamann        /** @var $move helper_plugin_move_op */
16*f4998c13SMichael Hamann        $move = plugin_load('helper', 'move_op');
17*f4998c13SMichael Hamann        if (!$move) return; // disable the test when move is not installed
18*f4998c13SMichael Hamann        saveWikiText('pagetomove', '<toc>
19*f4998c13SMichael Hamann  * [[index|Index of the page]]
20*f4998c13SMichael Hamann    * [[foo:bar|Index of the sub namespace]]
21*f4998c13SMichael Hamann      * [[foo:index|Index of the sub/sub namespace]]
22*f4998c13SMichael Hamann    * [[.:foo:page|Page in the sub namespace]]
23*f4998c13SMichael Hamann</toc>', 'testcase created');
24*f4998c13SMichael Hamann        idx_addPage('pagetomove');
25*f4998c13SMichael Hamann        $this->assertTrue($move->movePage('pagetomove', 'test:movedpage'));
26*f4998c13SMichael Hamann        $this->assertEquals('<toc>
27*f4998c13SMichael Hamann  * [[:index|Index of the page]]
28*f4998c13SMichael Hamann    * [[foo:bar|Index of the sub namespace]]
29*f4998c13SMichael Hamann      * [[foo:index|Index of the sub/sub namespace]]
30*f4998c13SMichael Hamann    * [[foo:page|Page in the sub namespace]]
31*f4998c13SMichael Hamann</toc>',rawWiki('test:movedpage'));
32*f4998c13SMichael Hamann    }
33*f4998c13SMichael Hamann}
34