packages/sql-semantics-postgres/tests/Unit/Statement/Object/Attribute/Known/DictionaryAttributeTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Object\Attribute\Known;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\Known\DictionaryAttribute;
11use SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\Reading;
12
13#[CoversClass(DictionaryAttribute::class)]
14#[Small]
15final class DictionaryAttributeTest extends TestCase
16{
17    public function testReadingFollowsTheCommand(): void
18    {
19        self::assertSame([Reading::TextSearchTemplate], [DictionaryAttribute::Template->reading()]);
20    }
21
22    public function testNamedComparesRespectingCase(): void
23    {
24        self::assertSame([DictionaryAttribute::Template, null], [DictionaryAttribute::named('template'), DictionaryAttribute::named('TEMPLATE')]);
25    }
26
27    public function testTextIsTheAttributeName(): void
28    {
29        self::assertSame('template', DictionaryAttribute::Template->text());
30    }
31}
32