Skip to content

Commit

Permalink
Quoter test (for increase test support) (#155)
Browse files Browse the repository at this point in the history
* Remove connection from Quoter

* Add tests for Quoter
  • Loading branch information
darkdef committed Oct 13, 2022
1 parent 3c66aea commit 8dcf41e
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions tests/QuoterTest.php
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Db\Pgsql\Tests;

use Yiisoft\Db\TestSupport\TestQuoterTrait;

/**
* @group pgsql
*/
final class QuoterTest extends TestCase
{
use TestQuoterTrait;

/**
* @return string[][]
*/
public function simpleTableNamesProvider(): array
{
return [
['test', 'test', ],
['te`st', 'te`st', ],
['te\'st', 'te\'st', ],
['current-table-name', 'current-table-name', ],
['"current-table-name"', 'current-table-name', ],
];
}

/**
* @return string[][]
*/
public function simpleColumnNamesProvider(): array
{
return [
['test', '"test"', 'test'],
['"test"', '"test"', 'test'],
['*', '*', '*'],
];
}

/**
* @return string[][]
*/
public function columnNamesProvider(): array
{
return [
['*', '*'],
['table.*', '"table".*'],
['"table".*', '"table".*'],
['table.column', '"table"."column"'],
['"table".column', '"table"."column"'],
['table."column"', '"table"."column"'],
['"table"."column"', '"table"."column"'],
];
}
}

0 comments on commit 8dcf41e

Please sign in to comment.