Add duplicate() function to Query Builder
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
f2b3871b21
commit
2cca3daa17
4 changed files with 72 additions and 3 deletions
20
tests/Functions/DuplicateFunctionTest.php
Normal file
20
tests/Functions/DuplicateFunctionTest.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Functions;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Functions\Duplicate;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class DuplicateFunctionTest extends TestCase
|
||||
{
|
||||
public function testSimpleDuplicate()
|
||||
{
|
||||
$expression = new Duplicate('tag', 'tag_dup');
|
||||
|
||||
$query = '|> duplicate(column: "tag", as: "tag_dup") ';
|
||||
|
||||
$this->assertEquals($query, $expression->__toString());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue