Movee Formatters to Type factory

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-08-16 15:06:32 +00:00
commit 4abd95f303
12 changed files with 40 additions and 68 deletions

View file

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace Tests\Generic;
use DateTime;
use Arendsen\FluxQueryBuilder\Formatters;
use PHPUnit\Framework\TestCase;
final class FormattersTest extends TestCase
{
public function testAssociativeArrayNested()
{
$array = [
'columns' => ['foo', 'bar'],
'mode' => 'by'
];
$expected = 'columns: ["foo", "bar"], mode: "by"';
$this->assertEquals($expected, Formatters::toFluxArrayString($array));
}
public function testDateTimeToString()
{
$dateTime = new DateTime('2022-08-12 17:31:00');
$expected = 'time(v: 2022-08-12T17:31:00Z)';
$this->assertEquals($expected, Formatters::dateTimeToString($dateTime));
}
}