2022-08-10 16:09:29 +00:00
|
|
|
<?php
|
2022-08-15 20:28:25 +00:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
declare( strict_types=1 );
|
2022-08-10 16:09:29 +00:00
|
|
|
|
2022-08-15 20:28:25 +00:00
|
|
|
namespace Tests\Functions;
|
|
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
use Hosterra\FluxBuilder\Functions\Group;
|
2022-08-10 16:09:29 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
final class GroupFunctionTest extends TestCase {
|
|
|
|
|
public function testSimpleGroup() {
|
|
|
|
|
$expression = new Group( [ 'foo', 'bar' ], 'by' );
|
2022-08-10 16:09:29 +00:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$query = '|> group(columns: ["foo", "bar"], mode: "by") ';
|
2022-08-10 16:09:29 +00:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$this->assertEquals( $query, $expression->__toString() );
|
|
|
|
|
}
|
2022-08-15 20:28:25 +00:00
|
|
|
}
|