mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2025-07-23 00:46:57 +00:00

This mostly corrects file and class names for PSR-2. Function names have not been adjusted yet
44 lines
890 B
PHP
44 lines
890 B
PHP
<?php
|
|
|
|
namespace dokuwiki\plugin\struct\test;
|
|
|
|
use dokuwiki\plugin\struct\meta\DateFormatConverter;
|
|
|
|
/**
|
|
* @group plugin_struct
|
|
* @group plugins
|
|
*/
|
|
class DateFormatConverterTest extends StructTest
|
|
{
|
|
public function data_todate()
|
|
{
|
|
return [
|
|
['Sometime %H:%M:%S %%', '\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @dataProvider data_todate
|
|
*/
|
|
public function test_todate($input, $expect)
|
|
{
|
|
$this->assertEquals($expect, DateFormatConverter::toDate($input));
|
|
}
|
|
|
|
|
|
public function data_tostrftime()
|
|
{
|
|
return [
|
|
['\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %', 'Sometime %H:%M:%S %%'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @dataProvider data_tostrftime
|
|
*/
|
|
public function test_tostrftime($input, $expect)
|
|
{
|
|
$this->assertEquals($expect, DateFormatConverter::toStrftime($input));
|
|
}
|
|
}
|