packages/sql-semantics-mysql/tests/Unit/Statement/Server/Storage/Option/EngineAttributeOptionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Server\Storage\Option;
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\Literal\Text;
12use SqlSemantics\Platform\MySql\Statement\Server\Storage\Option\EngineAttributeOption;
13
14#[CoversClass(EngineAttributeOption::class)]
15#[Medium]
16final class EngineAttributeOptionTest extends TestCase
17{
18    public function testRenderWritesTheOption(): void
19    {
20        self::assertSame("CREATE TABLESPACE ts ENGINE_ATTRIBUTE '{}'", (new Semantics())->analyze("create tablespace ts engine_attribute = '{}'")->toString());
21    }
22
23    public function testKeywordNamesTheOption(): void
24    {
25        self::assertSame('ENGINE_ATTRIBUTE', (new EngineAttributeOption(new Text('{}')))->keyword());
26    }
27}
28