flux-querybuilder/tests/Functions/LastFunctionTest.php

29 lines
600 B
PHP
Raw Normal View History

2023-02-10 11:40:35 +01:00
<?php
declare(strict_types=1);
namespace Tests\Functions;
use Arendsen\FluxQueryBuilder\Functions\Last;
use PHPUnit\Framework\TestCase;
final class LastFunctionTest extends TestCase
{
2023-02-10 11:46:54 +01:00
public function testSimpleLast()
{
$expression = new Last();
2023-02-10 11:40:35 +01:00
2023-02-10 11:46:54 +01:00
$query = '|> last(column: "_value") ';
2023-02-10 11:40:35 +01:00
2023-02-10 11:46:54 +01:00
$this->assertEquals($query, $expression->__toString());
}
2023-02-10 11:40:35 +01:00
2023-02-10 11:46:54 +01:00
public function testLastWithValue()
{
$expression = new Last('something');
2023-02-10 11:40:35 +01:00
2023-02-10 11:46:54 +01:00
$query = '|> last(column: "something") ';
2023-02-10 11:40:35 +01:00
2023-02-10 11:46:54 +01:00
$this->assertEquals($query, $expression->__toString());
}
2023-02-10 11:40:35 +01:00
}