xref: /dokuwiki/lib/plugins/styling/_test/general.test.php (revision 73dc0a8919857718a3b64a4c0741b57580a34b2a)
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 */
8*73dc0a89SAndreas Gohruse dokuwiki\MailUtils;
9*73dc0a89SAndreas Gohr
10123bc813SAndreas Gohrclass general_plugin_styling_test extends DokuWikiTest {
11123bc813SAndreas Gohr
12123bc813SAndreas Gohr    /**
13123bc813SAndreas Gohr     * Simple test to make sure the plugin.info.txt is in correct format
14123bc813SAndreas Gohr     */
15123bc813SAndreas Gohr    public function test_plugininfo() {
16123bc813SAndreas Gohr        $file = __DIR__.'/../plugin.info.txt';
17123bc813SAndreas Gohr        $this->assertFileExists($file);
18123bc813SAndreas Gohr
19123bc813SAndreas Gohr        $info = confToHash($file);
20123bc813SAndreas Gohr
21123bc813SAndreas Gohr        $this->assertArrayHasKey('base', $info);
22123bc813SAndreas Gohr        $this->assertArrayHasKey('author', $info);
23123bc813SAndreas Gohr        $this->assertArrayHasKey('email', $info);
24123bc813SAndreas Gohr        $this->assertArrayHasKey('date', $info);
25123bc813SAndreas Gohr        $this->assertArrayHasKey('name', $info);
26123bc813SAndreas Gohr        $this->assertArrayHasKey('desc', $info);
27123bc813SAndreas Gohr        $this->assertArrayHasKey('url', $info);
28123bc813SAndreas Gohr
29123bc813SAndreas Gohr        $this->assertEquals('styling', $info['base']);
3092682be1SAndreas Gohr        $this->assertMatchesRegularExpression('/^https?:\/\//', $info['url']);
31*73dc0a89SAndreas Gohr        $this->assertTrue(MailUtils::isValid($info['email']));
3292682be1SAndreas Gohr        $this->assertMatchesRegularExpression('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
33123bc813SAndreas Gohr        $this->assertTrue(false !== strtotime($info['date']));
34123bc813SAndreas Gohr    }
35123bc813SAndreas Gohr}
36