packages/sql-catalog/tests/Unit/Platform/Sqlite/DialectTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Platform\Sqlite;
6
7use PHPUnit\Framework\TestCase;
8
9#[\PHPUnit\Framework\Attributes\CoversClass(\SqlCatalog\Platform\Sqlite\Dialect::class)]
10final class DialectTest extends TestCase
11{
12    public function testIdentifierQuoteMatchesTheLanguage(): void
13    {
14        self::assertSame('"', (new \SqlCatalog\Platform\Sqlite\Dialect())->identifierQuote());
15    }
16
17    public function testInsertPrefixPreservesConflictHandling(): void
18    {
19        self::assertSame('insert into ', (new \SqlCatalog\Platform\Sqlite\Dialect())->insertPrefix(false));
20        self::assertSame('insert or ignore into ', (new \SqlCatalog\Platform\Sqlite\Dialect())->insertPrefix(true));
21    }
22
23    public function testInsertSuffixPreservesConflictHandling(): void
24    {
25        self::assertSame('', (new \SqlCatalog\Platform\Sqlite\Dialect())->insertSuffix(false));
26        self::assertSame('', (new \SqlCatalog\Platform\Sqlite\Dialect())->insertSuffix(true));
27    }
28
29    public function testReturningSuffixNamesHowTheGeneratedKeyIsRead(): void
30    {
31        self::assertSame('', (new \SqlCatalog\Platform\Sqlite\Dialect())->returningSuffix());
32    }
33}
34