1<?php 2 3/** 4 * General tests for the advanced plugin 5 * 6 * @group plugin_advanced 7 * @group plugins 8 */ 9class general_plugin_advanced_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 $file = __DIR__.'/../plugin.info.txt'; 16 $this->assertFileExists($file); 17 18 $info = confToHash($file); 19 20 $this->assertArrayHasKey('base', $info); 21 $this->assertArrayHasKey('author', $info); 22 $this->assertArrayHasKey('email', $info); 23 $this->assertArrayHasKey('date', $info); 24 $this->assertArrayHasKey('name', $info); 25 $this->assertArrayHasKey('desc', $info); 26 $this->assertArrayHasKey('url', $info); 27 28 $this->assertEquals('advanced', $info['base']); 29 $this->assertRegExp('/^https?:\/\//', $info['url']); 30 $this->assertTrue(mail_isvalid($info['email'])); 31 $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']); 32 $this->assertTrue(false !== strtotime($info['date'])); 33 } 34} 35