packages/sql-semantics-mysql/tests/Unit/Statement/Server/Flush/FlushTest.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\Flush;
12
13#[CoversClass(Flush::class)]
14#[Medium]
15final class FlushTest extends TestCase
16{
17 public function testRenderWritesTheItems(): void
18 {
19 self::assertSame('FLUSH NO_WRITE_TO_BINLOG PRIVILEGES, RELAY LOGS', (new Semantics())->analyze('flush no_write_to_binlog privileges, relay logs')->toString());
20 }
21
22 public function testDeriveStatementHasNoFacts(): void
23 {
24 $operation = (new Semantics())->analyze('FLUSH LOGS');
25
26 self::assertSame([], $operation->facts->diagnostics);
27 self::assertNull($operation->facts->output);
28 }
29}
30