packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/Publication/Subscription/AlterSubscriptionPublicationsTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\Publication\Subscription;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\Subscription\AlterSubscriptionPublications::class)]
12#[Medium]
13final class AlterSubscriptionPublicationsTest extends TestCase
14{
15    public function testRenderWritesTheAction(): void
16    {
17        self::assertSame('ALTER SUBSCRIPTION s SET PUBLICATION p3, p4 WITH (refresh = FALSE)', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER SUBSCRIPTION s SET PUBLICATION p3, p4 WITH (refresh = false)')->toString());
18    }
19
20    public function testDeriveStatementDerivesTheOptions(): void
21    {
22        self::assertSame([], (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER SUBSCRIPTION s DROP PUBLICATION p')->facts->diagnostics);
23    }
24}
25