packages/sql-semantics-mysql/tests/Unit/Rules/Dml/HandlerFactsTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Rules\Dml;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Rules\Dml\HandlerFacts;
11use SqlSemantics\Platform\MySql\Semantics;
12
13#[CoversClass(HandlerFacts::class)]
14#[Medium]
15final class HandlerFactsTest extends TestCase
16{
17    public function testReadRecordsTheRowsOfTheHandler(): void
18    {
19        $operation = (new Semantics())->analyze('HANDLER h READ i = (1) WHERE h.a = 2 LIMIT 1');
20
21        self::assertNotNull($operation->facts->output);
22        self::assertSame([], $operation->facts->diagnostics);
23    }
24}
25