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