packages/sql-semantics-postgres/tests/Unit/Statement/Manipulation/Prepared/DeallocateTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Manipulation\Prepared;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Prepared\Deallocate::class)]
12#[Medium]
13final class DeallocateTest extends TestCase
14{
15    public function testDeriveStatementDerivesNothing(): void
16    {
17        $semantics = new \SqlSemantics\Platform\PostgreSql\Semantics('pg-17.2');
18        $query = $semantics->analyze('DEALLOCATE p');
19        self::assertNull($query->facts->output);
20    }
21
22    public function testRenderDropsTheIgnoredKeyword(): void
23    {
24        $semantics = new \SqlSemantics\Platform\PostgreSql\Semantics('pg-17.2');
25        $query = $semantics->analyze('DEALLOCATE PREPARE p');
26        self::assertSame('DEALLOCATE p', $query->toString());
27    }
28}
29