packages/sql-semantics-postgres/tests/Unit/Statement/Utility/Transaction/SavepointActionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Utility\Transaction;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Transaction\SavepointAction::class)]
12#[Medium]
13final class SavepointActionTest extends TestCase
14{
15    public function testEachCommandHasItsAction(): void
16    {
17        $statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RELEASE s')->statement;
18        self::assertInstanceOf(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Transaction\SavepointCommand::class, $statement);
19        self::assertSame(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Transaction\SavepointAction::Release, $statement->action);
20    }
21}
22