xref: /dokuwiki/lib/plugins/styling/_test/general.test.php (revision 92682be191f82226e4ee18a010951608b19087d6)
1123bc813SAndreas Gohr<?php
2123bc813SAndreas Gohr/**
3123bc813SAndreas Gohr * General tests for the styling plugin
4123bc813SAndreas Gohr *
5123bc813SAndreas Gohr * @group plugin_styling
6123bc813SAndreas Gohr * @group plugins
7123bc813SAndreas Gohr */
8123bc813SAndreas Gohrclass general_plugin_styling_test extends DokuWikiTest {
9123bc813SAndreas Gohr
10123bc813SAndreas Gohr    /**
11123bc813SAndreas Gohr     * Simple test to make sure the plugin.info.txt is in correct format
12123bc813SAndreas Gohr     */
13123bc813SAndreas Gohr    public function test_plugininfo() {
14123bc813SAndreas Gohr        $file = __DIR__.'/../plugin.info.txt';
15123bc813SAndreas Gohr        $this->assertFileExists($file);
16123bc813SAndreas Gohr
17123bc813SAndreas Gohr        $info = confToHash($file);
18123bc813SAndreas Gohr
19123bc813SAndreas Gohr        $this->assertArrayHasKey('base', $info);
20123bc813SAndreas Gohr        $this->assertArrayHasKey('author', $info);
21123bc813SAndreas Gohr        $this->assertArrayHasKey('email', $info);
22123bc813SAndreas Gohr        $this->assertArrayHasKey('date', $info);
23123bc813SAndreas Gohr        $this->assertArrayHasKey('name', $info);
24123bc813SAndreas Gohr        $this->assertArrayHasKey('desc', $info);
25123bc813SAndreas Gohr        $this->assertArrayHasKey('url', $info);
26123bc813SAndreas Gohr
27123bc813SAndreas Gohr        $this->assertEquals('styling', $info['base']);
28*92682be1SAndreas Gohr        $this->assertMatchesRegularExpression('/^https?:\/\//', $info['url']);
29123bc813SAndreas Gohr        $this->assertTrue(mail_isvalid($info['email']));
30*92682be1SAndreas Gohr        $this->assertMatchesRegularExpression('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
31123bc813SAndreas Gohr        $this->assertTrue(false !== strtotime($info['date']));
32123bc813SAndreas Gohr    }
33123bc813SAndreas Gohr}
34