packages/sql-semantics/tests/Unit/Statement/CommandTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\Attributes\UsesClass;
10use PHPUnit\Framework\TestCase;
11use SqlSemantics\Statement\Command;
12use SqlSemantics\Statement\Model\Sqlite\Value\CmdWithCommitEndTransOpt_ccca6149 as Commit;
13use SqlSemantics\Statement\Model\Sqlite\Value\TransOptWithTransaction_ea573324 as Transaction;
14use SqlSemantics\Statement\Statement;
15
16#[CoversClass(Command::class)]
17#[UsesClass(\SqlSemantics\Statement\Assertion::class)]
18#[UsesClass(\SqlSemantics\Statement\ImmutableGraph::class)]
19#[UsesClass(\SqlSemantics\Statement\Writer::class)]
20#[UsesClass(Statement::class)]
21#[Medium]
22final class CommandTest extends TestCase
23{
24 public function testWriteWithCompleteCommand(): void
25 {
26 $command = new Commit('COMMIT', new Transaction());
27 $statement = new Statement($command);
28 self::assertSame('COMMIT TRANSACTION', $statement->toString());
29 }
30}
31