Passed
Pull Request — master (#4)
by Mark
01:28
created

action_plugin_description_test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testHeaders() 0 9 1
A setUp() 0 7 1
1
<?php
2
3
/**
4
 * Action tests for the description plugin.
5
 *
6
 * @group plugin_description
7
 * @group plugins
8
 *
9
 * @author Mark C. Prins <[email protected]>
10
 *
11
 * @noinspection AutoloadingIssuesInspection
12
 * @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
13
 */
14
class action_plugin_description_test extends DokuWikiTest
15
{
16
    protected $pluginsEnabled = array('description');
17
18
    public function setUp(): void
19
    {
20
        parent::setUp();
21
22
        global $conf;
23
        $conf['allowdebug'] = 1;
24
        $conf['keyword_source'] = 'abstract';
25
    }
26
27
    /**
28
     * @throws Exception if anything goes wrong
29
     */
30
    final public function testHeaders(): void
31
    {
32
        $request = new TestRequest();
33
        $response = $request->get(array('id' => 'wiki:syntax'));
34
35
        // check description meta headers
36
        $this->assertStringContainsString(
37
            'DokuWiki supports some simple markup language',
38
            $response->queryHTML('meta[name="description"]')->attr('content')
39
        );
40
    }
41
}
42