Marks fork as 2.0.0.
This commit is contained in:
parent
d93a6b5c09
commit
8d8de4a2b0
81 changed files with 1921 additions and 3954 deletions
|
|
@ -1,43 +1,40 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace Tests\Functions;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Functions\AggregateWindow;
|
||||
use Arendsen\FluxQueryBuilder\Type\FnType;
|
||||
use Hosterra\FluxBuilder\Functions\AggregateWindow;
|
||||
use Hosterra\FluxBuilder\Type\FnType;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class AggregateWindowFunctionTest extends TestCase
|
||||
{
|
||||
public function testSimpleWindow()
|
||||
{
|
||||
$expression = new AggregateWindow('20s', 'mean');
|
||||
final class AggregateWindowFunctionTest extends TestCase {
|
||||
public function testSimpleWindow() {
|
||||
$expression = new AggregateWindow( '20s', 'mean' );
|
||||
|
||||
$query = '|> aggregateWindow(every: 20s, fn: mean) ';
|
||||
$query = '|> aggregateWindow(every: 20s, fn: mean) ';
|
||||
|
||||
$this->assertEquals($query, $expression->__toString());
|
||||
}
|
||||
$this->assertEquals( $query, $expression->__toString() );
|
||||
}
|
||||
|
||||
public function testAllParameters()
|
||||
{
|
||||
$expression = new AggregateWindow(
|
||||
'20s',
|
||||
FnType::params(['r'])->withBody('r._field == "test"'),
|
||||
[
|
||||
'period' => 'every',
|
||||
'offset' => '0s',
|
||||
'location' => 'location',
|
||||
'column' => '_value',
|
||||
'timeSrc' => '_stop',
|
||||
'timeDst' => '_time',
|
||||
'createEmpty' => false
|
||||
]
|
||||
);
|
||||
public function testAllParameters() {
|
||||
$expression = new AggregateWindow(
|
||||
'20s',
|
||||
FnType::params( [ 'r' ] )->withBody( 'r._field == "test"' ),
|
||||
[
|
||||
'period' => 'every',
|
||||
'offset' => '0s',
|
||||
'location' => 'location',
|
||||
'column' => '_value',
|
||||
'timeSrc' => '_stop',
|
||||
'timeDst' => '_time',
|
||||
'createEmpty' => false
|
||||
]
|
||||
);
|
||||
|
||||
$query = '|> aggregateWindow(every: 20s, period: every, offset: 0s, fn: (r) => r._field == "test", ' .
|
||||
'location: "location", ' . 'column: "_value", timeSrc: "_stop", timeDst: "_time", createEmpty: false) ';
|
||||
$query = '|> aggregateWindow(every: 20s, period: every, offset: 0s, fn: (r) => r._field == "test", ' .
|
||||
'location: "location", ' . 'column: "_value", timeSrc: "_stop", timeDst: "_time", createEmpty: false) ';
|
||||
|
||||
$this->assertEquals($query, $expression->__toString());
|
||||
}
|
||||
$this->assertEquals( $query, $expression->__toString() );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue