reduce config complexity by converting php format to js format (#734)

This commit is contained in:
Kevin Papst
2019-04-29 00:24:23 +02:00
committed by GitHub
parent 1b0b45649d
commit b8811924c3
7 changed files with 89 additions and 62 deletions

View File

@@ -0,0 +1,29 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Utils;
use App\Utils\MomentFormatConverter;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* @covers \App\Utils\MomentFormatConverter
*/
class MomentFormatConverterTest extends KernelTestCase
{
public function test()
{
$sut = new MomentFormatConverter();
$this->assertEquals('DD.MM.YYYY HH:mm', $sut->convert('dd.MM.yyyy HH:mm'));
$this->assertEquals('DD-MM-YYYY HH:mm', $sut->convert('dd-MM-yyyy HH:mm'));
$this->assertEquals('DD/MM/YYYY HH:mm', $sut->convert('dd/MM/yyyy HH:mm'));
$this->assertEquals('YYYY-MM-DD HH:mm', $sut->convert('yyyy-MM-dd HH:mm'));
$this->assertEquals('YYYY.MM.DD. HH:mm', $sut->convert('yyyy.MM.dd. HH:mm'));
}
}