Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions tests/QuoterTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Db\Mssql\Tests;

use Yiisoft\Db\TestSupport\TestQuoterTrait;

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

/**
* @return string[][]
*/
public function simpleTableNamesProvider(): array
{
return [
['test', 'test', ],
['te`st', 'te`st', ],
['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]'],
];
}
}