Add script 'get-openssl-version.sh'.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Color handling tests for the styling plugin
|
||||
*
|
||||
* @group plugin_styling
|
||||
* @group plugins
|
||||
*/
|
||||
class colors_plugin_styling_test extends DokuWikiTest
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @see testColorType
|
||||
*/
|
||||
public function provideColorType()
|
||||
{
|
||||
return [
|
||||
['foobar', 'text'],
|
||||
['white', 'text'],
|
||||
['#fff', 'color'],
|
||||
['#f0f0f0', 'color'],
|
||||
['#f0f0', 'text'],
|
||||
['some #f0f0f0 color', 'text'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $input
|
||||
* @param string $expect
|
||||
* @dataProvider provideColorType
|
||||
* @noinspection PhpUnhandledExceptionInspection
|
||||
* @noinspection PhpDocMissingThrowsInspection
|
||||
*/
|
||||
public function testColorType($input, $expect)
|
||||
{
|
||||
$plugin = new admin_plugin_styling();
|
||||
$output = $this->callInaccessibleMethod($plugin, 'colorType', [$input]);
|
||||
$this->assertEquals($expect, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @see testColorValue
|
||||
*/
|
||||
public function provideColorValue()
|
||||
{
|
||||
return [
|
||||
['foobar', 'foobar'],
|
||||
['white', 'white'],
|
||||
['#fff', '#ffffff'],
|
||||
['#123', '#112233'],
|
||||
['#f0f0f0', '#f0f0f0'],
|
||||
['#f0f0', '#f0f0'],
|
||||
['some #f0f0f0 color', 'some #f0f0f0 color'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $input
|
||||
* @param string $expect
|
||||
* @dataProvider provideColorValue
|
||||
* @noinspection PhpUnhandledExceptionInspection
|
||||
* @noinspection PhpDocMissingThrowsInspection
|
||||
*/
|
||||
public function testColorValue($input, $expect)
|
||||
{
|
||||
$plugin = new admin_plugin_styling();
|
||||
$output = $this->callInaccessibleMethod($plugin, 'colorValue', [$input]);
|
||||
$this->assertEquals($expect, $output);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* General tests for the styling plugin
|
||||
*
|
||||
* @group plugin_styling
|
||||
* @group plugins
|
||||
*/
|
||||
class general_plugin_styling_test extends DokuWikiTest {
|
||||
|
||||
/**
|
||||
* Simple test to make sure the plugin.info.txt is in correct format
|
||||
*/
|
||||
public function test_plugininfo() {
|
||||
$file = __DIR__.'/../plugin.info.txt';
|
||||
$this->assertFileExists($file);
|
||||
|
||||
$info = confToHash($file);
|
||||
|
||||
$this->assertArrayHasKey('base', $info);
|
||||
$this->assertArrayHasKey('author', $info);
|
||||
$this->assertArrayHasKey('email', $info);
|
||||
$this->assertArrayHasKey('date', $info);
|
||||
$this->assertArrayHasKey('name', $info);
|
||||
$this->assertArrayHasKey('desc', $info);
|
||||
$this->assertArrayHasKey('url', $info);
|
||||
|
||||
$this->assertEquals('styling', $info['base']);
|
||||
$this->assertRegExp('/^https?:\/\//', $info['url']);
|
||||
$this->assertTrue(mail_isvalid($info['email']));
|
||||
$this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
|
||||
$this->assertTrue(false !== strtotime($info['date']));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user