flux-querybuilder/tests/Functions/FromFunctionTest.php
davidarendsen 39ae737fa1 Fix coding style with phpcs PSR-12 standard
Signed-off-by: davidarendsen <davidarendsen@hey.com>
2022-08-15 20:28:25 +00:00

40 lines
921 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Functions;
use Arendsen\FluxQueryBuilder\Functions\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") '
],
];
}
}