packages/sql-semantics-mysql/tests/Unit/Statement/View/ViewCheckOptionTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\View;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Statement\View\ViewCheckOption;
11
12#[CoversClass(ViewCheckOption::class)]
13#[Small]
14final class ViewCheckOptionTest extends TestCase
15{
16 public function testCasesHoldTheirKeywords(): void
17 {
18 self::assertSame('CASCADED', ViewCheckOption::Cascaded->value);
19 self::assertSame('', ViewCheckOption::Unqualified->value);
20 }
21
22 public function testCascadesTellsWhetherUnderlyingViewsAreChecked(): void
23 {
24 self::assertTrue(ViewCheckOption::Unqualified->cascades());
25 self::assertTrue(ViewCheckOption::Cascaded->cascades());
26 self::assertFalse(ViewCheckOption::Local->cascades());
27 }
28}
29