packages/sql-semantics-sqlite/tests/Unit/Statement/Schema/Reference/MatchNameTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Schema\Reference;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\Sqlite\Model\Rendering\Lexical;
11use SqlSemantics\Platform\Sqlite\Model\Rendering\Output;
12use SqlSemantics\Platform\Sqlite\Model\Statement\Identifier\Name;
13use SqlSemantics\Platform\Sqlite\Rendering\Codec;
14use SqlSemantics\Platform\Sqlite\Statement\Schema\Reference\MatchName;
15
16#[CoversClass(MatchName::class)]
17#[Small]
18final class MatchNameTest extends TestCase
19{
20    public function testRenderWritesTheKeywordAndTheName(): void
21    {
22        $out = new Output(new Codec());
23        (new MatchName(new Name('partial')))->render($out);
24
25        self::assertSame('MATCH partial', (new Lexical())->join($out->pieces()));
26    }
27}
28