Add KeyValue expression

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-08-05 18:51:35 +00:00
commit b2d1bd403c
7 changed files with 67 additions and 92 deletions

View file

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Arendsen\FluxQueryBuilder\Function\From;
use PHPUnit\Framework\TestCase;
final class FromFunctionTest extends TestCase {
/**
* @dataProvider somethingProvider
*/
public function testSomething($settings, $query)
{
$expression = new From($settings);
$this->assertEquals($expression->__toString(), $query);
}
public function somethingProvider(): array
{
return [
'from bucket' => [
[
'bucket' => 'test-bucket',
],
'from(bucket: "test-bucket") '
],
'from bucket and host' => [
[
'bucket' => 'test-bucket',
'host' => 'test',
],
'from(bucket: "test-bucket", host: "test") '
],
];
}
}