packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/Extension/ExtensionVersionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\Extension;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Extension\ExtensionVersion::class)]
12#[Medium]
13final class ExtensionVersionTest extends TestCase
14{
15    public function testOptionOfTheOldVersion(): void
16    {
17        self::assertSame('old_version', (new \SqlSemantics\Platform\PostgreSql\Statement\Catalog\Extension\ExtensionVersion(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Extension\VersionRole::Source, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('1.0')))->option());
18    }
19
20    public function testRenderKeepsAWordVersion(): void
21    {
22        self::assertSame('CREATE EXTENSION e VERSION v1', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE EXTENSION e VERSION v1')->toString());
23    }
24}
25