packages/sql-semantics-postgres/tests/Unit/Statement/Utility/Session/ResetTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Utility\Session;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Reset::class)]
12#[Medium]
13final class ResetTest extends TestCase
14{
15    public function testDeriveStatementRecordsNoProblem(): void
16    {
17        self::assertSame([], (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET ALL')->facts->diagnostics);
18    }
19
20    public function testRenderWritesEachForm(): void
21    {
22        self::assertSame(['RESET ALL', 'RESET a.b', 'RESET TIME ZONE', 'RESET TRANSACTION ISOLATION LEVEL', 'RESET SESSION AUTHORIZATION'], [(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET ALL')->toString(), (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET a.b')->toString(), (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET TIME ZONE')->toString(), (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET TRANSACTION ISOLATION LEVEL')->toString(), (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RESET SESSION AUTHORIZATION')->toString()]);
23    }
24}
25