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