packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/Database/DropDatabaseTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\Database;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Database\DropDatabase::class)]
12#[Medium]
13final class DropDatabaseTest extends TestCase
14{
15 public function testRenderWritesWithBeforeTheOptions(): void
16 {
17 self::assertSame('DROP DATABASE IF EXISTS d WITH (FORCE)', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('DROP DATABASE IF EXISTS d (FORCE)')->toString());
18 }
19
20 public function testDeriveStatementRecordsNothing(): void
21 {
22 self::assertSame([], (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('DROP DATABASE d')->facts->diagnostics);
23 }
24}
25