1<?php
2
3/**
4 * General tests for the webdav plugin
5 *
6 * @group plugin_webdav
7 * @group plugins
8 */
9class general_plugin_webdav_test extends DokuWikiTest
10{
11    /**
12     * Simple test to make sure the plugin.info.txt is in correct format
13     */
14    public function test_plugininfo()
15    {
16        $file = __DIR__ . '/../plugin.info.txt';
17        $this->assertFileExists($file);
18
19        $info = confToHash($file);
20
21        $this->assertArrayHasKey('base', $info);
22        $this->assertArrayHasKey('author', $info);
23        $this->assertArrayHasKey('email', $info);
24        $this->assertArrayHasKey('date', $info);
25        $this->assertArrayHasKey('name', $info);
26        $this->assertArrayHasKey('desc', $info);
27        $this->assertArrayHasKey('url', $info);
28
29        $this->assertEquals('webdav', $info['base']);
30        $this->assertRegExp('/^https?:\/\//', $info['url']);
31        $this->assertTrue(mail_isvalid($info['email']));
32        $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
33        $this->assertTrue(false !== strtotime($info['date']));
34    }
35}
36