2023-02-12 17:18:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
declare( strict_types=1 );
|
2023-02-12 17:18:23 +01:00
|
|
|
|
|
|
|
|
namespace Tests\Functions;
|
|
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
use Hosterra\FluxBuilder\Functions\Min;
|
2023-02-12 17:18:23 +01:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
final class MinFunctionTest extends TestCase {
|
|
|
|
|
public function testSimpleMin() {
|
|
|
|
|
$expression = new Min();
|
2023-02-12 17:18:23 +01:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$query = '|> min() ';
|
2023-02-12 17:18:23 +01:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$this->assertEquals( $query, $expression->__toString() );
|
|
|
|
|
}
|
2023-02-12 17:18:23 +01:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
public function testMinWithColumn() {
|
|
|
|
|
$expression = new Min( 'something' );
|
2023-02-12 17:18:23 +01:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$query = '|> min(column: "something") ';
|
2023-02-12 17:18:23 +01:00
|
|
|
|
2024-03-30 16:44:38 +01:00
|
|
|
$this->assertEquals( $query, $expression->__toString() );
|
|
|
|
|
}
|
2023-02-12 17:18:23 +01:00
|
|
|
}
|