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