packages/sql-semantics-mysql/tests/Unit/Statement/Table/Problem/WrongRelationKindTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Table\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name;
11use SqlSemantics\Platform\MySql\Model\Statement\Identifier\QualifiedName;
12use SqlSemantics\Platform\MySql\Statement\Table\Problem\KindRefusal;
13use SqlSemantics\Platform\MySql\Statement\Table\Problem\WrongRelationKind;
14
15#[CoversClass(WrongRelationKind::class)]
16#[Small]
17final class WrongRelationKindTest extends TestCase
18{
19 public function testMessageNamesTheRelationAndTheRefusal(): void
20 {
21 self::assertSame('shop.t is not VIEW.', (new WrongRelationKind(new QualifiedName(new Name('t'), new Name('shop')), KindRefusal::NotView))->message());
22 self::assertSame('v is not BASE TABLE.', (new WrongRelationKind(new QualifiedName(new Name('v')), KindRefusal::NotBaseTable))->message());
23 }
24}
25