1<?php
2/**
3 * General tests for the acknowledge plugin
4 *
5 * @group plugin_acknowledge
6 * @group plugins
7 */
8class general_plugin_acknowledge_test extends DokuWikiTest
9{
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('acknowledge', $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