packages/sql-parser/tests/Unit/Table/ArrayRowsTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Table;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlParser\Table\ArrayRows;
11
12#[CoversClass(ArrayRows::class)]
13#[Small]
14final class ArrayRowsTest extends TestCase
15{
16    public function testRow(): void
17    {
18        $rows = new ArrayRows([[1 => 2], [3 => -1]]);
19
20        self::assertSame([3 => -1], $rows->row(1));
21        self::assertSame([], $rows->row(7));
22    }
23
24    public function testCount(): void
25    {
26        self::assertSame(2, (new ArrayRows([[], []]))->count());
27    }
28}
29