packages/sql-semantics-mysql/tests/Unit/Lowering/Server/Storage/LogfileGroupRuleTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Lowering\Server\Storage;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Medium;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Lowering\Server\Storage\LogfileGroupRule;
11use SqlSemantics\Platform\MySql\Semantics;
12
13#[CoversClass(LogfileGroupRule::class)]
14#[Medium]
15final class LogfileGroupRuleTest extends TestCase
16{
17 public function testStatementLowersAlterOf5x(): void
18 {
19 self::assertSame("ALTER LOGFILE GROUP g ADD REDOFILE 'r' INITIAL_SIZE 1", (new Semantics('mysql-5.7.44'))->analyze("alter logfile group g add redofile 'r' initial_size 1")->toString());
20 }
21
22 public function testFileLowersAnUndoFile(): void
23 {
24 self::assertSame("CREATE LOGFILE GROUP g ADD UNDOFILE 'u'", (new Semantics())->analyze("create logfile group g add undofile 'u'")->toString());
25 }
26}
27