packages/sql-semantics-postgres/tests/Unit/Statement/Catalog/TextSearch/ReplaceTextSearchDictionaryTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Catalog\TextSearch;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\TextSearch\ReplaceTextSearchDictionary::class)]
12#[Medium]
13final class ReplaceTextSearchDictionaryTest extends TestCase
14{
15    public function testRenderWithoutTokens(): void
16    {
17        self::assertSame('ALTER TEXT SEARCH CONFIGURATION c ALTER MAPPING REPLACE english WITH swedish', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TEXT SEARCH CONFIGURATION c ALTER MAPPING REPLACE english WITH swedish')->toString());
18    }
19
20    public function testRenderWithTokens(): void
21    {
22        self::assertSame('ALTER TEXT SEARCH CONFIGURATION c ALTER MAPPING FOR a, b REPLACE english WITH swedish', (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TEXT SEARCH CONFIGURATION c ALTER MAPPING FOR a, b REPLACE english WITH swedish')->toString());
23    }
24
25    public function testDeriveStatementRecordsNothing(): void
26    {
27        self::assertSame([], (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TEXT SEARCH CONFIGURATION c ALTER MAPPING REPLACE a WITH b')->facts->diagnostics);
28    }
29}
30