xref: /plugin/publish/_test/helper.test.php (revision 91a2d0d1b727abbe19da2bc02aab7fcf44192a75)
1<?php
2/**
3 * tests or the class helper_plugin_publish of the publish plugin
4 *
5 * @group plugin_publish
6 * @group plugins
7 */
8class helper_plugin_publish_test extends DokuWikiTest {
9
10    public function setUp() {
11        parent::setUp();
12    }
13
14    protected $pluginsEnabled = array('publish',);
15
16    /**
17     *
18     */
19    public function test_in_namespace() {
20
21        /** @var helper_plugin_publish $helper */
22        $helper = plugin_load('helper', 'publish');
23        $this->assertTrue($helper->in_namespace("de:sidebar en:sidebar", 'de:sidebar'));
24        $this->assertTrue($helper->in_namespace("de:sidebar en:sidebar", 'en:sidebar'));
25    }
26
27    public function test_isActive() {
28        global $conf;
29
30        $conf['plugin']['publish']['no_apr_namespaces'] = 'de:sidebar en:sidebar';
31
32        /** @var helper_plugin_publish $helper */
33        $helper = plugin_load('helper', 'publish');
34
35        $this->assertFalse($helper->isActive('de:sidebar'), 'de:sidebar is still listed as active');
36        $this->assertFalse($helper->isActive('en:sidebar'), 'en:sidebar is still listed as active');
37    }
38
39}