packages/sql-semantics-mysql/tests/Unit/Statement/Server/Flush/FlushItemTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Server\Flush;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Semantics;
11use SqlSemantics\Platform\MySql\Statement\Server\Flush\FlushItem;
12use SqlSemantics\Platform\MySql\Statement\Server\Flush\FlushOption;
13
14#[CoversClass(FlushItem::class)]
15#[Medium]
16final class FlushItemTest extends TestCase
17{
18    public function testRenderWritesTheOption(): void
19    {
20        self::assertSame('FLUSH ERROR LOGS, ENGINE LOGS, GENERAL LOGS, SLOW LOGS, LOGS, STATUS', (new Semantics('mysql-5.6.51'))->analyze('flush error logs, engine logs, general logs, slow logs, logs, status')->toString());
21    }
22
23    public function testChannelIsNullByDefault(): void
24    {
25        self::assertNull((new FlushItem(FlushOption::Logs))->channel);
26    }
27}
28