Add Types
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
02810bd7fa
commit
a50e33ba04
5 changed files with 93 additions and 1 deletions
36
tests/Type/FactoryTypeTest.php
Normal file
36
tests/Type/FactoryTypeTest.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Type;
|
||||
|
||||
use DateTime;
|
||||
use Arendsen\FluxQueryBuilder\Type;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class FactoryTypeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getFluxStringProvider
|
||||
*/
|
||||
public function testGetFluxString($value, $expected)
|
||||
{
|
||||
$type = new Type($value);
|
||||
|
||||
$this->assertEquals($expected, $type->__toString());
|
||||
}
|
||||
|
||||
public function getFluxStringProvider()
|
||||
{
|
||||
return [
|
||||
'DateTime' => [
|
||||
new DateTime('2022-08-15 23:09:00'),
|
||||
'time(v: 2022-08-15T23:09:00Z)',
|
||||
],
|
||||
'String' => [
|
||||
'value',
|
||||
'"value"',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue