packages/sql-semantics-postgres/tests/Unit/Statement/Object/Attribute/Known/ConfigurationAttributeTest.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\ConfigurationAttribute;
11use SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\Reading;
12
13#[CoversClass(ConfigurationAttribute::class)]
14#[Small]
15final class ConfigurationAttributeTest extends TestCase
16{
17 public function testReadingFollowsTheCommand(): void
18 {
19 self::assertSame([Reading::TextSearchParser, Reading::TextSearchConfiguration], [ConfigurationAttribute::Parser->reading(), ConfigurationAttribute::Copy->reading()]);
20 }
21
22 public function testNamedComparesRespectingCase(): void
23 {
24 self::assertSame([ConfigurationAttribute::Parser, null], [ConfigurationAttribute::named('parser'), ConfigurationAttribute::named('PARSER')]);
25 }
26
27 public function testTextIsTheAttributeName(): void
28 {
29 self::assertSame('parser', ConfigurationAttribute::Parser->text());
30 }
31}
32