packages/sql-semantics-mysql/tests/Unit/Statement/Server/Problem/SpatialProblemTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Statement\Server\Problem;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlSemantics\Platform\MySql\Statement\Server\Problem\SpatialProblem;
11use SqlSemantics\Platform\MySql\Statement\Server\Problem\SpatialRule;
12use SqlSemantics\Platform\MySql\Statement\Server\Spatial\SpatialAttributeKind;
13
14#[CoversClass(SpatialProblem::class)]
15#[Small]
16final class SpatialProblemTest extends TestCase
17{
18 public function testMessageDescribesEachRule(): void
19 {
20 self::assertSame('SRID 0 cannot be modified (ER_CANT_MODIFY_SRID_0).', (new SpatialProblem(SpatialRule::IdentifierZero))->message());
21 self::assertSame('Attribute NAME is too long (ER_SRS_ATTRIBUTE_STRING_TOO_LONG).', (new SpatialProblem(SpatialRule::TooLong, SpatialAttributeKind::Name))->message());
22 }
23}
24