Add mean() method to Query Builder
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
ff3c757543
commit
f2b3871b21
4 changed files with 74 additions and 3 deletions
29
tests/Functions/MeanFunctionTest.php
Normal file
29
tests/Functions/MeanFunctionTest.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Functions;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Functions\Mean;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class MeanFunctionTest extends TestCase
|
||||
{
|
||||
public function testSimpleMean()
|
||||
{
|
||||
$expression = new Mean();
|
||||
|
||||
$query = '|> mean() ';
|
||||
|
||||
$this->assertEquals($query, $expression->__toString());
|
||||
}
|
||||
|
||||
public function testWithParameterColumn()
|
||||
{
|
||||
$expression = new Mean('test');
|
||||
|
||||
$query = '|> mean(column: "test") ';
|
||||
|
||||
$this->assertEquals($query, $expression->__toString());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue