packages/sql-semantics-postgres/tests/Unit/Statement/Utility/Maintenance/CheckpointTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Utility\Maintenance;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\PostgreSql\Semantics;
11use SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Checkpoint;
12
13#[CoversClass(Checkpoint::class)]
14#[Medium]
15final class CheckpointTest extends TestCase
16{
17    public function testDeriveStatementRecordsNothing(): void
18    {
19        $operation = (new Semantics())->analyze('CHECKPOINT');
20        self::assertSame([[], null], [$operation->facts->diagnostics, $operation->facts->output]);
21    }
22
23    public function testRenderWritesTheKeyword(): void
24    {
25        self::assertSame('CHECKPOINT', (new Semantics())->analyze('checkpoint')->toString());
26    }
27}
28