Skip to content

Commit

Permalink
Revert "Remove src\TestSupport\TestQuoterTrait from yiisoft\db."
Browse files Browse the repository at this point in the history
This reverts commit 1f9a1ca.
  • Loading branch information
terabytesoftw committed Dec 17, 2022
1 parent 1f9a1ca commit 72099f4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -23,7 +23,7 @@
"ext-mbstring": "*",
"ext-pdo": "*",
"yiisoft/arrays": "^2.0",
"yiisoft/db": "dev-remove-test-quoter-trait as 3.0@dev",
"yiisoft/db": "^3.0@dev",
"yiisoft/strings": "^2.0"
},
"require-dev": {
Expand Down
24 changes: 0 additions & 24 deletions tests/Provider/QuoterProvider.php

This file was deleted.

49 changes: 40 additions & 9 deletions tests/QuoterTest.php
Expand Up @@ -4,23 +4,54 @@

namespace Yiisoft\Db\Sqlite\Tests;

use Yiisoft\Db\Sqlite\Tests\Support\TestTrait;
use Yiisoft\Db\Tests\AbstractQuoterTest;
use Yiisoft\Db\TestSupport\TestQuoterTrait;

/**
* @group sqlite
*
* @psalm-suppress PropertyNotSetInConstructor
*/
final class QuoterTest extends AbstractQuoterTest
final class QuoterTest extends TestCase
{
use TestTrait;
use TestQuoterTrait;

/**
* @dataProvider \Yiisoft\Db\Sqlite\Tests\Provider\QuoterProvider::tableNameParts()
* @return string[][]
*/
public function testGetTableNameParts(string $tableName, string ...$expected): void
public function simpleTableNamesProvider(): array
{
parent::testGetTableNameParts($tableName, ...$expected);
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 72099f4

Please sign in to comment.