packages/sql-semantics-sqlite/tests/Unit/Statement/Schema/Problem/PrimaryKeyFlawTest.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\PrimaryKeyFlaw;
11
12#[CoversClass(PrimaryKeyFlaw::class)]
13#[Small]
14final class PrimaryKeyFlawTest extends TestCase
15{
16    public function testCasesDescribeEachFlaw(): void
17    {
18        self::assertSame(['Repeated', 'MissingWithoutRowid', 'ExpressionTerm', 'AutoincrementNotIntegerKey', 'AutoincrementWithoutRowid'], array_column(PrimaryKeyFlaw::cases(), 'name'));
19        self::assertSame('The table has more than one primary key.', PrimaryKeyFlaw::Repeated->value);
20    }
21}
22