Browse Source

refactored database tests

- changed test class naming for easier copying and searching of classes
- made base tests abstract and made MySQL an equal citisen in the test
  hierarchie
- added missing db specific test classes
ar-bug
Carsten Brandt 8 years ago
parent
commit
8ba032d147
  1. 2
      tests/framework/data/ActiveDataProviderTest.php
  2. 9
      tests/framework/db/ActiveRecordTest.php
  3. 11
      tests/framework/db/BatchQueryResultTest.php
  4. 11
      tests/framework/db/ColumnSchemaBuilderTest.php
  5. 25
      tests/framework/db/ColumnSchemaTest.php
  6. 6
      tests/framework/db/CommandTest.php
  7. 6
      tests/framework/db/ConnectionTest.php
  8. 11
      tests/framework/db/DatabaseTestCase.php
  9. 6
      tests/framework/db/QueryTest.php
  10. 14
      tests/framework/db/SchemaTest.php
  11. 5
      tests/framework/db/cubrid/ActiveDataProviderTest.php
  12. 5
      tests/framework/db/cubrid/ActiveRecordTest.php
  13. 5
      tests/framework/db/cubrid/BatchQueryResultTest.php
  14. 6
      tests/framework/db/cubrid/ColumnSchemaBuilderTest.php
  15. 5
      tests/framework/db/cubrid/CommandTest.php
  16. 5
      tests/framework/db/cubrid/ConnectionTest.php
  17. 3
      tests/framework/db/cubrid/QueryBuilderTest.php
  18. 12
      tests/framework/db/cubrid/QueryTest.php
  19. 4
      tests/framework/db/cubrid/SchemaTest.php
  20. 5
      tests/framework/db/mssql/ActiveDataProviderTest.php
  21. 6
      tests/framework/db/mssql/ActiveRecordTest.php
  22. 12
      tests/framework/db/mssql/BatchQueryResultTest.php
  23. 24
      tests/framework/db/mssql/ColumnSchemaBuilderTest.php
  24. 3
      tests/framework/db/mssql/CommandTest.php
  25. 4
      tests/framework/db/mssql/ConnectionTest.php
  26. 3
      tests/framework/db/mssql/QueryBuilderTest.php
  27. 4
      tests/framework/db/mssql/QueryTest.php
  28. 12
      tests/framework/db/mssql/SchemaTest.php
  29. 13
      tests/framework/db/mysql/ActiveDataProviderTest.php
  30. 12
      tests/framework/db/mysql/ActiveRecordTest.php
  31. 12
      tests/framework/db/mysql/BatchQueryResultTest.php
  32. 6
      tests/framework/db/mysql/ColumnSchemaBuilderTest.php
  33. 12
      tests/framework/db/mysql/CommandTest.php
  34. 12
      tests/framework/db/mysql/ConnectionTest.php
  35. 5
      tests/framework/db/mysql/QueryBuilderTest.php
  36. 12
      tests/framework/db/mysql/QueryTest.php
  37. 12
      tests/framework/db/mysql/SchemaTest.php
  38. 13
      tests/framework/db/oci/ActiveDataProviderTest.php
  39. 4
      tests/framework/db/oci/ActiveRecordTest.php
  40. 12
      tests/framework/db/oci/BatchQueryResultTest.php
  41. 6
      tests/framework/db/oci/ColumnSchemaBuilderTest.php
  42. 4
      tests/framework/db/oci/CommandTest.php
  43. 12
      tests/framework/db/oci/ConnectionTest.php
  44. 16
      tests/framework/db/oci/OracleActiveDataProviderTest.php
  45. 3
      tests/framework/db/oci/QueryBuilderTest.php
  46. 4
      tests/framework/db/oci/QueryTest.php
  47. 3
      tests/framework/db/oci/SchemaTest.php
  48. 5
      tests/framework/db/pgsql/ActiveDataProviderTest.php
  49. 3
      tests/framework/db/pgsql/ActiveRecordTest.php
  50. 12
      tests/framework/db/pgsql/BatchQueryResultTest.php
  51. 24
      tests/framework/db/pgsql/ColumnSchemaBuilderTest.php
  52. 5
      tests/framework/db/pgsql/CommandTest.php
  53. 4
      tests/framework/db/pgsql/ConnectionTest.php
  54. 3
      tests/framework/db/pgsql/QueryBuilderTest.php
  55. 4
      tests/framework/db/pgsql/QueryTest.php
  56. 3
      tests/framework/db/pgsql/SchemaTest.php
  57. 5
      tests/framework/db/sqlite/ActiveDataProviderTest.php
  58. 5
      tests/framework/db/sqlite/ActiveRecordTest.php
  59. 12
      tests/framework/db/sqlite/BatchQueryResultTest.php
  60. 6
      tests/framework/db/sqlite/ColumnSchemaBuilderTest.php
  61. 5
      tests/framework/db/sqlite/CommandTest.php
  62. 4
      tests/framework/db/sqlite/ConnectionTest.php
  63. 3
      tests/framework/db/sqlite/QueryBuilderTest.php
  64. 3
      tests/framework/db/sqlite/QueryTest.php
  65. 5
      tests/framework/db/sqlite/SchemaTest.php

2
tests/framework/data/ActiveDataProviderTest.php

@ -22,7 +22,7 @@ use yiiunit\data\ar\Order;
* @group data
* @group db
*/
class ActiveDataProviderTest extends DatabaseTestCase
abstract class ActiveDataProviderTest extends DatabaseTestCase
{
protected function setUp()
{

9
tests/framework/db/ActiveRecordTest.php

@ -1,4 +1,5 @@
<?php
namespace yiiunit\framework\db;
use yii\db\ActiveQuery;
@ -16,16 +17,12 @@ use yiiunit\data\ar\OrderWithNullFK;
use yiiunit\data\ar\Profile;
use yiiunit\data\ar\Type;
use yiiunit\framework\ar\ActiveRecordTestTrait;
use yiiunit\framework\db\cubrid\CubridActiveRecordTest;
use yiiunit\framework\db\cubrid\ActiveRecordTest as CubridActiveRecordTest;
use yiiunit\data\ar\Animal;
use yiiunit\data\ar\Cat;
use yiiunit\data\ar\Dog;
/**
* @group db
* @group mysql
*/
class ActiveRecordTest extends DatabaseTestCase
abstract class ActiveRecordTest extends DatabaseTestCase
{
use ActiveRecordTestTrait;

11
tests/framework/db/BatchQueryResultTest.php

@ -1,9 +1,4 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\db;
@ -13,11 +8,7 @@ use yii\db\Query;
use yii\db\BatchQueryResult;
use yiiunit\data\ar\Customer;
/**
* @group db
* @group mysql
*/
class BatchQueryResultTest extends DatabaseTestCase
abstract class BatchQueryResultTest extends DatabaseTestCase
{
public function setUp()
{

11
tests/framework/db/ColumnSchemaBuilderTest.php

@ -1,22 +1,13 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\db;
use yii\db\ColumnSchemaBuilder;
use yii\db\Expression;
use yii\db\Schema;
use yiiunit\TestCase;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder
*/
class ColumnSchemaBuilderTest extends TestCase
abstract class ColumnSchemaBuilderTest extends TestCase
{
/**
* @param string $type

25
tests/framework/db/ColumnSchemaTest.php

@ -1,25 +0,0 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\db;
use yii\db\ColumnSchema;
use yii\db\Schema;
use yiiunit\TestCase;
/**
* ColumnSchemaTest tests ColumnSchema
*/
class ColumnSchemaTest extends TestCase
{
public function testDbTypecastWithEmptyCharType()
{
$columnSchema = new ColumnSchema(['type' => Schema::TYPE_CHAR]);
$this->assertSame('', $columnSchema->dbTypecast(''));
}
}

6
tests/framework/db/CommandTest.php

@ -8,11 +8,7 @@ use yii\db\DataReader;
use yii\db\Expression;
use yii\db\Schema;
/**
* @group db
* @group mysql
*/
class CommandTest extends DatabaseTestCase
abstract class CommandTest extends DatabaseTestCase
{
public function testConstruct()
{

6
tests/framework/db/ConnectionTest.php

@ -5,11 +5,7 @@ namespace yiiunit\framework\db;
use yii\db\Connection;
use yii\db\Transaction;
/**
* @group db
* @group mysql
*/
class ConnectionTest extends DatabaseTestCase
abstract class ConnectionTest extends DatabaseTestCase
{
public function testConstruct()

11
tests/framework/db/DatabaseTestCase.php

@ -1,4 +1,5 @@
<?php
namespace yiiunit\framework\db;
use yii\db\Connection;
@ -7,14 +8,22 @@ use yiiunit\TestCase as TestCase;
abstract class DatabaseTestCase extends TestCase
{
protected $database;
protected $driverName = 'mysql';
/**
* @var string the driver name of this test class. Must be set by a subclass.
*/
protected $driverName;
/**
* @var Connection
*/
private $_db;
protected function setUp()
{
if ($this->driverName === null) {
throw new \Exception('driverName is not set for a DatabaseTestCase.');
}
parent::setUp();
$databases = self::getParam('databases');
$this->database = $databases[$this->driverName];

6
tests/framework/db/QueryTest.php

@ -5,11 +5,7 @@ namespace yiiunit\framework\db;
use yii\db\Expression;
use yii\db\Query;
/**
* @group db
* @group mysql
*/
class QueryTest extends DatabaseTestCase
abstract class QueryTest extends DatabaseTestCase
{
public function testSelect()
{

14
tests/framework/db/SchemaTest.php

@ -4,14 +4,11 @@ namespace yiiunit\framework\db;
use PDO;
use yii\caching\FileCache;
use yii\db\ColumnSchema;
use yii\db\Expression;
use yii\db\Schema;
/**
* @group db
* @group mysql
*/
class SchemaTest extends DatabaseTestCase
abstract class SchemaTest extends DatabaseTestCase
{
public function pdoAttributesProvider()
{
@ -373,4 +370,11 @@ class SchemaTest extends DatabaseTestCase
}
}
}
public function testColumnSchemaDbTypecastWithEmptyCharType()
{
$columnSchema = new ColumnSchema(['type' => Schema::TYPE_CHAR]);
$this->assertSame('', $columnSchema->dbTypecast(''));
}
}

5
tests/framework/db/cubrid/CubridActiveDataProviderTest.php → tests/framework/db/cubrid/ActiveDataProviderTest.php

@ -1,14 +1,13 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yiiunit\framework\data\ActiveDataProviderTest;
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
* @group data
*/
class CubridActiveDataProviderTest extends ActiveDataProviderTest
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'cubrid';
}

5
tests/framework/db/cubrid/CubridQueryTest.php → tests/framework/db/cubrid/ActiveRecordTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yiiunit\framework\db\QueryTest;
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
*/
class CubridQueryTest extends QueryTest
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
public $driverName = 'cubrid';
}

5
tests/framework/db/cubrid/CubridActiveRecordTest.php → tests/framework/db/cubrid/BatchQueryResultTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yiiunit\framework\db\ActiveRecordTest;
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
*/
class CubridActiveRecordTest extends ActiveRecordTest
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'cubrid';
}

6
tests/framework/db/cubrid/ColumnSchemaBuilderTest.php

@ -1,14 +1,16 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yii\db\cubrid\ColumnSchemaBuilder;
use yii\db\Schema;
use \yiiunit\framework\db\ColumnSchemaBuilderTest as BaseColumnSchemaBuilderTest;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for Cubrid
* @group db
* @group cubrid
*/
class ColumnSchemaBuilderTest extends BaseColumnSchemaBuilderTest
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type

5
tests/framework/db/cubrid/CubridCommandTest.php → tests/framework/db/cubrid/CommandTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yiiunit\framework\db\CommandTest;
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
*/
class CubridCommandTest extends CommandTest
class CommandTest extends \yiiunit\framework\db\CommandTest
{
public $driverName = 'cubrid';

5
tests/framework/db/cubrid/CubridConnectionTest.php → tests/framework/db/cubrid/ConnectionTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yiiunit\framework\db\ConnectionTest;
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
*/
class CubridConnectionTest extends ConnectionTest
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
public $driverName = 'cubrid';

3
tests/framework/db/cubrid/CubridQueryBuilderTest.php → tests/framework/db/cubrid/QueryBuilderTest.php

@ -3,13 +3,12 @@
namespace yiiunit\framework\db\cubrid;
use yii\db\Schema;
use yiiunit\framework\db\QueryBuilderTest;
/**
* @group db
* @group cubrid
*/
class CubridQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
public $driverName = 'cubrid';

12
tests/framework/db/cubrid/QueryTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\cubrid;
/**
* @group db
* @group cubrid
*/
class QueryTest extends \yiiunit\framework\db\QueryTest
{
public $driverName = 'cubrid';
}

4
tests/framework/db/cubrid/CubridSchemaTest.php → tests/framework/db/cubrid/SchemaTest.php

@ -1,14 +1,14 @@
<?php
namespace yiiunit\framework\db\cubrid;
use yii\db\Expression;
use yiiunit\framework\db\SchemaTest;
/**
* @group db
* @group cubrid
*/
class CubridSchemaTest extends SchemaTest
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
public $driverName = 'cubrid';

5
tests/framework/db/mssql/MssqlActiveDataProviderTest.php → tests/framework/db/mssql/ActiveDataProviderTest.php

@ -1,14 +1,13 @@
<?php
namespace yiiunit\framework\db\mssql;
use yiiunit\framework\data\ActiveDataProviderTest;
namespace yiiunit\framework\db\mssql;
/**
* @group db
* @group mssql
* @group data
*/
class MssqlActiveDataProviderTest extends ActiveDataProviderTest
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'sqlsrv';
}

6
tests/framework/db/mssql/MssqlActiveRecordTest.php → tests/framework/db/mssql/ActiveRecordTest.php

@ -2,15 +2,13 @@
namespace yiiunit\framework\db\mssql;
use yiiunit\framework\db\ActiveRecordTest;
/**
* @group db
* @group mssql
*/
class MssqlActiveRecordTest extends ActiveRecordTest
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
protected $driverName = 'sqlsrv';
public $driverName = 'sqlsrv';
public function testExplicitPkOnAutoIncrement()
{

12
tests/framework/db/mssql/BatchQueryResultTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mssql;
/**
* @group db
* @group mssql
*/
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'sqlsrv';
}

24
tests/framework/db/mssql/ColumnSchemaBuilderTest.php

@ -0,0 +1,24 @@
<?php
namespace yiiunit\framework\db\mssql;
use yii\db\ColumnSchemaBuilder;
use yii\db\Schema;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for MSSQL
* @group db
* @group mssql
*/
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type
* @param integer $length
* @return ColumnSchemaBuilder
*/
public function getColumnSchemaBuilder($type, $length = null)
{
return new ColumnSchemaBuilder($type, $length);
}
}

3
tests/framework/db/mssql/MssqlCommandTest.php → tests/framework/db/mssql/CommandTest.php

@ -3,13 +3,12 @@
namespace yiiunit\framework\db\mssql;
use yii\db\Schema;
use yiiunit\framework\db\CommandTest;
/**
* @group db
* @group mssql
*/
class MssqlCommandTest extends CommandTest
class CommandTest extends \yiiunit\framework\db\CommandTest
{
protected $driverName = 'sqlsrv';

4
tests/framework/db/mssql/MssqlConnectionTest.php → tests/framework/db/mssql/ConnectionTest.php

@ -2,13 +2,11 @@
namespace yiiunit\framework\db\mssql;
use yiiunit\framework\db\ConnectionTest;
/**
* @group db
* @group mssql
*/
class MssqlConnectionTest extends ConnectionTest
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
protected $driverName = 'sqlsrv';

3
tests/framework/db/mssql/MssqlQueryBuilderTest.php → tests/framework/db/mssql/QueryBuilderTest.php

@ -3,14 +3,13 @@
namespace yiiunit\framework\db\mssql;
use yii\db\mssql\Schema;
use yiiunit\framework\db\QueryBuilderTest;
use yii\db\Query;
/**
* @group db
* @group mssql
*/
class MssqlQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
public $driverName = 'sqlsrv';

4
tests/framework/db/mssql/MssqlQueryTest.php → tests/framework/db/mssql/QueryTest.php

@ -2,13 +2,11 @@
namespace yiiunit\framework\db\mssql;
use yiiunit\framework\db\QueryTest;
/**
* @group db
* @group mssql
*/
class MssqlQueryTest extends QueryTest
class QueryTest extends \yiiunit\framework\db\QueryTest
{
protected $driverName = 'sqlsrv';
}

12
tests/framework/db/mssql/SchemaTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mssql;
/**
* @group db
* @group mssql
*/
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
public $driverName = 'sqlsrv';
}

13
tests/framework/db/mysql/ActiveDataProviderTest.php

@ -0,0 +1,13 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
* @group data
*/
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'mysql';
}

12
tests/framework/db/mysql/ActiveRecordTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
public $driverName = 'mysql';
}

12
tests/framework/db/mysql/BatchQueryResultTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'mysql';
}

6
tests/framework/db/mysql/ColumnSchemaBuilderTest.php

@ -1,14 +1,16 @@
<?php
namespace yiiunit\framework\db\mysql;
use yii\db\mysql\ColumnSchemaBuilder;
use yii\db\Schema;
use \yiiunit\framework\db\ColumnSchemaBuilderTest as BaseColumnSchemaBuilderTest;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for MySQL
* @group db
* @group mysql
*/
class ColumnSchemaBuilderTest extends BaseColumnSchemaBuilderTest
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type

12
tests/framework/db/mysql/CommandTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class CommandTest extends \yiiunit\framework\db\CommandTest
{
public $driverName = 'mysql';
}

12
tests/framework/db/mysql/ConnectionTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
protected $driverName = 'mysql';
}

5
tests/framework/db/mysql/MysqlQueryBuilderTest.php → tests/framework/db/mysql/QueryBuilderTest.php

@ -3,14 +3,15 @@
namespace yiiunit\framework\db\mysql;
use yii\db\Schema;
use yiiunit\framework\db\QueryBuilderTest;
/**
* @group db
* @group mysql
*/
class MysqlQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
protected $driverName = 'mysql';
/**
* this is not used as a dataprovider for testGetColumnType to speed up the test
* when used as dataprovider every single line will cause a reconnect with the database which is not needed here

12
tests/framework/db/mysql/QueryTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class QueryTest extends \yiiunit\framework\db\QueryTest
{
protected $driverName = 'mysql';
}

12
tests/framework/db/mysql/SchemaTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mysql;
/**
* @group db
* @group mysql
*/
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
public $driverName = 'mysql';
}

13
tests/framework/db/oci/ActiveDataProviderTest.php

@ -0,0 +1,13 @@
<?php
namespace yiiunit\framework\db\oci;
/**
* @group db
* @group oci
* @group data
*/
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'oci';
}

4
tests/framework/db/oci/OracleActiveRecordTest.php → tests/framework/db/oci/ActiveRecordTest.php

@ -1,7 +1,7 @@
<?php
namespace yiiunit\framework\db\oci;
use yiiunit\framework\db\ActiveRecordTest;
use yiiunit\data\ar\DefaultPk;
use yiiunit\data\ar\Type;
@ -9,7 +9,7 @@ use yiiunit\data\ar\Type;
* @group db
* @group oci
*/
class OracleActiveRecordTest extends ActiveRecordTest
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
protected $driverName = 'oci';

12
tests/framework/db/oci/BatchQueryResultTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\oci;
/**
* @group db
* @group oci
*/
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'oci';
}

6
tests/framework/db/oci/ColumnSchemaBuilderTest.php

@ -1,14 +1,16 @@
<?php
namespace yiiunit\framework\db\oci;
use yii\db\oci\ColumnSchemaBuilder;
use yii\db\Schema;
use \yiiunit\framework\db\ColumnSchemaBuilderTest as BaseColumnSchemaBuilderTest;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for Oracle
* @group db
* @group oci
*/
class ColumnSchemaBuilderTest extends BaseColumnSchemaBuilderTest
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type

4
tests/framework/db/oci/OracleCommandTest.php → tests/framework/db/oci/CommandTest.php

@ -1,14 +1,14 @@
<?php
namespace yiiunit\framework\db\oci;
use yii\db\Schema;
use yiiunit\framework\db\CommandTest;
/**
* @group db
* @group oci
*/
class OracleCommandTest extends CommandTest
class CommandTest extends \yiiunit\framework\db\CommandTest
{
protected $driverName = 'oci';

12
tests/framework/db/oci/ConnectionTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\oci;
/**
* @group db
* @group oci
*/
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
protected $driverName = 'oci';
}

16
tests/framework/db/oci/OracleActiveDataProviderTest.php

@ -1,16 +0,0 @@
<?php
namespace yiiunit\framework\db\oci;
use yiiunit\framework\data\ActiveDataProviderTest;
use yii\data\ActiveDataProvider;
use yiiunit\data\ar\Order;
/**
* @group db
* @group oci
* @group data
*/
class OracleActiveDataProviderTest extends ActiveDataProviderTest
{
public $driverName = 'oci';
}

3
tests/framework/db/oci/OracleQueryBuilderTest.php → tests/framework/db/oci/QueryBuilderTest.php

@ -3,13 +3,12 @@
namespace yiiunit\framework\db\oci;
use yii\db\oci\Schema;
use yiiunit\framework\db\QueryBuilderTest;
/**
* @group db
* @group oci
*/
class OracleQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
public $driverName = 'oci';

4
tests/framework/db/oci/OracleQueryTest.php → tests/framework/db/oci/QueryTest.php

@ -1,14 +1,14 @@
<?php
namespace yiiunit\framework\db\oci;
use yiiunit\framework\db\QueryTest;
use yii\db\Query;
/**
* @group db
* @group oci
*/
class OracleQueryTest extends QueryTest
class QueryTest extends \yiiunit\framework\db\QueryTest
{
protected $driverName = 'oci';

3
tests/framework/db/oci/OracleSchemaTest.php → tests/framework/db/oci/SchemaTest.php

@ -4,13 +4,12 @@ namespace yiiunit\framework\db\oci;
use yii\db\Expression;
use yii\db\oci\Schema;
use yiiunit\framework\db\SchemaTest;
/**
* @group db
* @group oci
*/
class OracleSchemaTest extends SchemaTest
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
public $driverName = 'oci';

5
tests/framework/db/pgsql/PostgreSQLActiveDataProviderTest.php → tests/framework/db/pgsql/ActiveDataProviderTest.php

@ -1,14 +1,13 @@
<?php
namespace yiiunit\framework\db\pgsql;
use yiiunit\framework\data\ActiveDataProviderTest;
namespace yiiunit\framework\db\pgsql;
/**
* @group db
* @group pgsql
* @group data
*/
class PostgreSQLActiveDataProviderTest extends ActiveDataProviderTest
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'pgsql';
}

3
tests/framework/db/pgsql/PostgreSQLActiveRecordTest.php → tests/framework/db/pgsql/ActiveRecordTest.php

@ -7,14 +7,13 @@ use yii\db\pgsql\Schema;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\DefaultPk;
use yiiunit\framework\ar\ActiveRecordTestTrait;
use yiiunit\framework\db\ActiveRecordTest;
use yiiunit\TestCase;
/**
* @group db
* @group pgsql
*/
class PostgreSQLActiveRecordTest extends ActiveRecordTest
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
protected $driverName = 'pgsql';

12
tests/framework/db/pgsql/BatchQueryResultTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\pgsql;
/**
* @group db
* @group pgsql
*/
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'pgsql';
}

24
tests/framework/db/pgsql/ColumnSchemaBuilderTest.php

@ -0,0 +1,24 @@
<?php
namespace yiiunit\framework\db\pgsql;
use yii\db\ColumnSchemaBuilder;
use yii\db\Schema;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for Oracle
* @group db
* @group pgsql
*/
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type
* @param integer $length
* @return ColumnSchemaBuilder
*/
public function getColumnSchemaBuilder($type, $length = null)
{
return new ColumnSchemaBuilder($type, $length);
}
}

5
tests/framework/db/pgsql/PostgreSQLCommandTest.php → tests/framework/db/pgsql/CommandTest.php

@ -1,13 +1,12 @@
<?php
namespace yii\tests\unit\framework\db\pgsql;
use yiiunit\framework\db\CommandTest;
namespace yii\tests\unit\framework\db\pgsql;
/**
* @group db
* @group pgsql
*/
class PostgreSQLCommandTest extends CommandTest
class CommandTest extends \yiiunit\framework\db\CommandTest
{
public $driverName = 'pgsql';

4
tests/framework/db/pgsql/PostgreSQLConnectionTest.php → tests/framework/db/pgsql/ConnectionTest.php

@ -1,14 +1,14 @@
<?php
namespace yiiunit\framework\db\pgsql;
use yii\db\Transaction;
use yiiunit\framework\db\ConnectionTest;
/**
* @group db
* @group pgsql
*/
class PostgreSQLConnectionTest extends ConnectionTest
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
protected $driverName = 'pgsql';

3
tests/framework/db/pgsql/PostgreSQLQueryBuilderTest.php → tests/framework/db/pgsql/QueryBuilderTest.php

@ -3,13 +3,12 @@
namespace yiiunit\framework\db\pgsql;
use yii\db\Schema;
use yiiunit\framework\db\QueryBuilderTest;
/**
* @group db
* @group pgsql
*/
class PostgreSQLQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
public $driverName = 'pgsql';

4
tests/framework/db/pgsql/PostgreSQLQueryTest.php → tests/framework/db/pgsql/QueryTest.php

@ -4,14 +4,12 @@ namespace yiiunit\framework\db\pgsql;
use yii\db\pgsql\Schema;
use yii\db\Query;
use yiiunit\framework\db\QueryTest;
use yiiunit\framework\db\SchemaTest;
/**
* @group db
* @group pgsql
*/
class PostgreSQLQueryTest extends QueryTest
class QueryTest extends \yiiunit\framework\db\QueryTest
{
public $driverName = 'pgsql';

3
tests/framework/db/pgsql/PostgreSQLSchemaTest.php → tests/framework/db/pgsql/SchemaTest.php

@ -6,13 +6,12 @@ use yii\db\Expression;
use yii\db\pgsql\Schema;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\Type;
use yiiunit\framework\db\SchemaTest;
/**
* @group db
* @group pgsql
*/
class PostgreSQLSchemaTest extends SchemaTest
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
public $driverName = 'pgsql';

5
tests/framework/db/sqlite/SqliteActiveDataProviderTest.php → tests/framework/db/sqlite/ActiveDataProviderTest.php

@ -1,14 +1,13 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yiiunit\framework\data\ActiveDataProviderTest;
namespace yiiunit\framework\db\sqlite;
/**
* @group db
* @group sqlite
* @group data
*/
class SqliteActiveDataProviderTest extends ActiveDataProviderTest
class ActiveDataProviderTest extends \yiiunit\framework\data\ActiveDataProviderTest
{
public $driverName = 'sqlite';
}

5
tests/framework/db/sqlite/SqliteActiveRecordTest.php → tests/framework/db/sqlite/ActiveRecordTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yiiunit\framework\db\ActiveRecordTest;
namespace yiiunit\framework\db\sqlite;
/**
* @group db
* @group sqlite
*/
class SqliteActiveRecordTest extends ActiveRecordTest
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
protected $driverName = 'sqlite';
}

12
tests/framework/db/sqlite/BatchQueryResultTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\sqlite;
/**
* @group db
* @group sqlite
*/
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest
{
public $driverName = 'sqlite';
}

6
tests/framework/db/sqlite/ColumnSchemaBuilderTest.php

@ -1,14 +1,16 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yii\db\sqlite\ColumnSchemaBuilder;
use yii\db\Schema;
use \yiiunit\framework\db\ColumnSchemaBuilderTest as BaseColumnSchemaBuilderTest;
/**
* ColumnSchemaBuilderTest tests ColumnSchemaBuilder for SQLite
* @group db
* @group sqlite
*/
class ColumnSchemaBuilderTest extends BaseColumnSchemaBuilderTest
class ColumnSchemaBuilderTest extends \yiiunit\framework\db\ColumnSchemaBuilderTest
{
/**
* @param string $type

5
tests/framework/db/sqlite/SqliteCommandTest.php → tests/framework/db/sqlite/CommandTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yiiunit\framework\db\CommandTest;
namespace yiiunit\framework\db\sqlite;
/**
* @group db
* @group sqlite
*/
class SqliteCommandTest extends CommandTest
class CommandTest extends \yiiunit\framework\db\CommandTest
{
protected $driverName = 'sqlite';

4
tests/framework/db/sqlite/SqliteConnectionTest.php → tests/framework/db/sqlite/ConnectionTest.php

@ -1,9 +1,9 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yii\db\Connection;
use yii\db\Transaction;
use yiiunit\framework\db\ConnectionTest;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\Customer;
@ -11,7 +11,7 @@ use yiiunit\data\ar\Customer;
* @group db
* @group sqlite
*/
class SqliteConnectionTest extends ConnectionTest
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
{
protected $driverName = 'sqlite';

3
tests/framework/db/sqlite/SqliteQueryBuilderTest.php → tests/framework/db/sqlite/QueryBuilderTest.php

@ -5,13 +5,12 @@ namespace yiiunit\framework\db\sqlite;
use yii\db\Query;
use yii\db\Schema;
use yiiunit\data\base\TraversableObject;
use yiiunit\framework\db\QueryBuilderTest;
/**
* @group db
* @group sqlite
*/
class SqliteQueryBuilderTest extends QueryBuilderTest
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
{
protected $driverName = 'sqlite';

3
tests/framework/db/sqlite/SqliteQueryTest.php → tests/framework/db/sqlite/QueryTest.php

@ -2,13 +2,12 @@
namespace yiiunit\framework\db\sqlite;
use yii\db\Query;
use yiiunit\framework\db\QueryTest;
/**
* @group db
* @group sqlite
*/
class SqliteQueryTest extends QueryTest
class QueryTest extends \yiiunit\framework\db\QueryTest
{
protected $driverName = 'sqlite';

5
tests/framework/db/sqlite/SqliteSchemaTest.php → tests/framework/db/sqlite/SchemaTest.php

@ -1,13 +1,12 @@
<?php
namespace yiiunit\framework\db\sqlite;
use yiiunit\framework\db\SchemaTest;
namespace yiiunit\framework\db\sqlite;
/**
* @group db
* @group sqlite
*/
class SqliteSchemaTest extends SchemaTest
class SchemaTest extends \yiiunit\framework\db\SchemaTest
{
protected $driverName = 'sqlite';
Loading…
Cancel
Save