packages/sql-semantics-mysql/tests/Unit/Statement/Account/Option/AccountOptionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Account\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\Account\Option\AccountOption;
12
13#[CoversClass(AccountOption::class)]
14#[Medium]
15final class AccountOptionTest extends TestCase
16{
17    public function testRenderWritesTheNumberAndItsUnit(): void
18    {
19        self::assertSame('CREATE USER u PASSWORD EXPIRE INTERVAL 90 DAY PASSWORD REUSE INTERVAL DEFAULT PASSWORD_LOCK_TIME UNBOUNDED FAILED_LOGIN_ATTEMPTS 3', (new Semantics())->analyze('create user u password expire interval 90 day password reuse interval default password_lock_time unbounded failed_login_attempts 3')->toString());
20    }
21}
22