flux-querybuilder/tests/Functions/SortFunctionTest.php

18 lines
400 B
PHP
Raw Permalink Normal View History

<?php
2024-03-30 16:44:38 +01:00
declare( strict_types=1 );
namespace Tests\Functions;
2024-03-30 16:44:38 +01:00
use Hosterra\FluxBuilder\Functions\Sort;
use PHPUnit\Framework\TestCase;
2024-03-30 16:44:38 +01:00
final class SortFunctionTest extends TestCase {
public function testSimpleSort() {
$expression = new Sort( [ 'foo', 'bar' ], true );
2024-03-30 16:44:38 +01:00
$query = '|> sort(columns: ["foo", "bar"], desc: true) ';
2024-03-30 16:44:38 +01:00
$this->assertEquals( $query, $expression->__toString() );
}
}