packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/Access/Role/RoleSystemIdTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\Access\Role;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Role\RoleSystemId::class)]
12#[Medium]
13final class RoleSystemIdTest extends TestCase
14{
15    public function testOptionIsNull(): void
16    {
17        self::assertSame(null, (new \SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Role\RoleSystemId(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('100')))->option());
18    }
19
20    public function testRenderWritesTheIdentifier(): void
21    {
22        self::assertSame('CREATE ROLE r SYSID 100', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE ROLE r SYSID 100')->toString());
23    }
24}
25