Add Flux from() and filter() methods

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-08-05 15:41:38 +00:00
commit e0e69b4beb
17 changed files with 2095 additions and 0 deletions

View file

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Arendsen\FluxQueryBuilder\Function\From;
use PHPUnit\Framework\TestCase;
final class FromExpressionTest 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") '
],
];
}
}