packages/sql-semantics-postgres/tests/Unit/Statement/Table/Partition/HashModulusTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Table\Partition;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlSemantics\Platform\PostgreSql\Statement\Table\Partition\HashModulus::class)]
12#[Medium]
13final class HashModulusTest extends TestCase
14{
15    public function testRenderWritesTheClauseAsWritten(): void
16    {
17        $semantics = new \SqlSemantics\Platform\PostgreSql\Semantics();
18        $statement = $semantics->inspect('CREATE TABLE p1 PARTITION OF p FOR VALUES WITH ("modulus" 2, remainder 0)', []);
19        self::assertSame('CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (modulus 2, remainder 0)', $statement->toString());
20    }
21}
22