packages/sql-parser/tests/Unit/Grammar/GrammarExceptionTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Grammar;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\Attributes\UsesClass;
10use PHPUnit\Framework\TestCase;
11use SqlParser\Grammar\GrammarException;
12use SqlParser\Grammar\UnknownSymbolException;
13
14#[CoversClass(GrammarException::class)]
15#[UsesClass(UnknownSymbolException::class)]
16#[Small]
17final class GrammarExceptionTest extends TestCase
18{
19 public function testCarriesAMessage(): void
20 {
21 self::assertSame('Symbol x is declared twice', (new GrammarException('Symbol x is declared twice'))->getMessage());
22 self::assertSame('Unknown grammar symbol: y', (new UnknownSymbolException('y'))->getMessage());
23 }
24}
25