packages/sql-semantics-mysql/tests/Unit/Statement/Call/KeywordFunctionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Call;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Statement\Call\KeywordFunction;
11
12#[CoversClass(KeywordFunction::class)]
13#[Small]
14final class KeywordFunctionTest extends TestCase
15{
16    public function testArityAnswersTheArgumentCountsOfTheGrammar(): void
17    {
18        self::assertSame([0, 0], KeywordFunction::Database->arity());
19        self::assertSame([2, -1], KeywordFunction::Interval->arity());
20        self::assertSame([0, -1], KeywordFunction::GeometryCollection->arity());
21    }
22
23    public function testResultAnswersTheResultCode(): void
24    {
25        self::assertSame('+C', KeywordFunction::Coalesce->result());
26        self::assertSame('ZR', KeywordFunction::If->result());
27    }
28}
29