packages/sql-semantics-mysql/tests/Unit/Statement/Dml/Load/TextFileFormatTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Dml\Load;
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\Dml\Load\TextFileFormat;
12
13#[CoversClass(TextFileFormat::class)]
14#[Medium]
15final class TextFileFormatTest extends TestCase
16{
17 public function testRenderWritesCharsetFieldsAndLines(): void
18 {
19 self::assertSame("SELECT 1 INTO OUTFILE 'f' CHARSET DEFAULT COLUMNS ESCAPED BY 'e' TERMINATED BY ',' LINES TERMINATED BY ';'", (new Semantics('mysql-5.7.44'))->analyze("select 1 into outfile 'f' character set default fields escaped by 'e' terminated by ',' lines terminated by ';'")->toString());
20 }
21}
22