packages/ztd-query-core/tests/Unit/Platform/IdentifierQuoterTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Platform;
6
7use PHPUnit\Framework\Attributes\CoversNothing;
8use Tests\Contract\IdentifierQuoterContractTest;
9use Tests\Fake\FakeIdentifierQuoter;
10use ZtdQuery\Platform\IdentifierQuoter;
11
12#[CoversNothing]
13final class IdentifierQuoterTest extends IdentifierQuoterContractTest
14{
15 public function createQuoter(): IdentifierQuoter
16 {
17 return new FakeIdentifierQuoter();
18 }
19
20 public function quoteCharacter(): string
21 {
22 return '"';
23 }
24
25 public function testQuoteWrapsTheIdentifierInWhateverTheDialectQuotesWith(): void
26 {
27 $quoted = $this->createQuoter()->quote('order');
28
29 self::assertStringStartsWith($this->quoteCharacter(), $quoted);
30 self::assertStringEndsWith($this->quoteCharacter(), $quoted);
31 }
32}
33