packages/sql-semantics-postgres/tests/Unit/Statement/Utility/Problem/UtilityProblemTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Utility\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Problem\UtilityProblem::class)]
12#[Small]
13final class UtilityProblemTest extends TestCase
14{
15    public function testMessageFillsTheSubjectsIn(): void
16    {
17        self::assertSame('unrecognized VACUUM option "fast"', (new \SqlSemantics\Platform\PostgreSql\Statement\Utility\Problem\UtilityProblem(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Problem\UtilityProblemKind::UnknownOption, ['VACUUM', 'fast']))->message());
18    }
19
20    public function testMessageOfARuleWithoutSubjects(): void
21    {
22        self::assertSame('no inline code specified', (new \SqlSemantics\Platform\PostgreSql\Statement\Utility\Problem\UtilityProblem(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Problem\UtilityProblemKind::NoInlineCode))->message());
23    }
24}
25