2022-08-10 16:09:29 +00:00
|
|
|
<?php
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2022-08-12 12:37:30 +00:00
|
|
|
use Arendsen\FluxQueryBuilder\Functions\Sort;
|
2022-08-10 16:09:29 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
|
|
final class SortFunctionTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
public function testSimpleSort()
|
|
|
|
|
{
|
|
|
|
|
$expression = new Sort(['foo', 'bar'], true);
|
|
|
|
|
|
|
|
|
|
$query = '|> sort(columns: ["foo", "bar"], desc: true) ';
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($query, $expression->__toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|