packages/sql-semantics-postgres/tests/Unit/Statement/Routine/Problem/RoutineProblemTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Routine\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\PostgreSql\Statement\Routine\Problem\RoutineProblem;
11use SqlSemantics\Platform\PostgreSql\Statement\Routine\Problem\RoutineProblemKind;
12
13#[CoversClass(RoutineProblem::class)]
14#[Small]
15final class RoutineProblemTest extends TestCase
16{
17 public function testMessageInsertsTheSubject(): void
18 {
19 self::assertSame('parameter name "a" used more than once', (new RoutineProblem(RoutineProblemKind::DuplicateParameter, 'a'))->message());
20 }
21
22 public function testMessageWithoutSubject(): void
23 {
24 self::assertSame('missing argument', (new RoutineProblem(RoutineProblemKind::MissingOperatorArgument))->message());
25 }
26}
27