packages/sql-semantics-sqlite/tests/Unit/Statement/Schema/Problem/GeneratedColumnFlawTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Schema\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\Sqlite\Statement\Schema\Problem\GeneratedColumnFlaw;
11
12#[CoversClass(GeneratedColumnFlaw::class)]
13#[Small]
14final class GeneratedColumnFlawTest extends TestCase
15{
16 public function testCasesDescribeEachFlaw(): void
17 {
18 self::assertSame(['WithDefault', 'InPrimaryKey', 'NoPlainColumn'], array_column(GeneratedColumnFlaw::cases(), 'name'));
19 self::assertSame('A generated column cannot be part of the PRIMARY KEY.', GeneratedColumnFlaw::InPrimaryKey->value);
20 }
21}
22