packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/Tablespace/CreateTablespaceTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\Tablespace;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Tablespace\CreateTablespace::class)]
12#[Medium]
13final class CreateTablespaceTest extends TestCase
14{
15    public function testRenderWritesOwnerLocationAndParameters(): void
16    {
17        self::assertSame('CREATE TABLESPACE fast OWNER app LOCATION \'/ssd\' WITH (random_page_cost = 1)', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLESPACE fast OWNER app LOCATION \'/ssd\' WITH (random_page_cost = 1)')->toString());
18    }
19
20    public function testDeriveStatementDerivesTheParameters(): void
21    {
22        self::assertSame([], (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLESPACE fast LOCATION \'/ssd\'')->facts->diagnostics);
23    }
24}
25