packages/sql-semantics-postgres/tests/Unit/Rules/Query/FetchCountsTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Rules\Query;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Rules\Query\FetchCounts::class)]
12#[Medium]
13final class FetchCountsTest extends TestCase
14{
15    public function testAdmitsAPrimaryExpressionOrASignedConstant(): void
16    {
17        self::assertSame([true, false], [(new \SqlSemantics\Platform\PostgreSql\Rules\Query\FetchCounts())->admits(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('1'))), (new \SqlSemantics\Platform\PostgreSql\Rules\Query\FetchCounts())->admits(new \SqlSemantics\Platform\PostgreSql\Statement\Expression\BinaryOperation(new \SqlSemantics\Platform\PostgreSql\Statement\Name\OperatorName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('+')), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('1')), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('1'))))]);
18    }
19}
20