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