Browse Source
- 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 classesar-bug
Carsten Brandt
8 years ago
98 changed files with 2308 additions and 2160 deletions
@ -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('')); |
||||
} |
||||
} |
@ -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'; |
||||
} |
@ -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'; |
||||
} |
@ -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'; |
||||
} |
@ -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'; |
||||
|
@ -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'; |
||||
|
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\cubrid; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group cubrid |
||||
*/ |
||||
class QueryTest extends \yiiunit\framework\db\QueryTest |
||||
{ |
||||
public $driverName = 'cubrid'; |
||||
} |
@ -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'; |
||||
|
@ -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'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mssql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mssql |
||||
*/ |
||||
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest |
||||
{ |
||||
public $driverName = 'sqlsrv'; |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mssql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mssql |
||||
*/ |
||||
class SchemaTest extends \yiiunit\framework\db\SchemaTest |
||||
{ |
||||
public $driverName = 'sqlsrv'; |
||||
} |
@ -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'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest |
||||
{ |
||||
public $driverName = 'mysql'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest |
||||
{ |
||||
public $driverName = 'mysql'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class CommandTest extends \yiiunit\framework\db\CommandTest |
||||
{ |
||||
public $driverName = 'mysql'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest |
||||
{ |
||||
protected $driverName = 'mysql'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class QueryTest extends \yiiunit\framework\db\QueryTest |
||||
{ |
||||
protected $driverName = 'mysql'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\mysql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group mysql |
||||
*/ |
||||
class SchemaTest extends \yiiunit\framework\db\SchemaTest |
||||
{ |
||||
public $driverName = 'mysql'; |
||||
} |
@ -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'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\oci; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group oci |
||||
*/ |
||||
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest |
||||
{ |
||||
public $driverName = 'oci'; |
||||
} |
@ -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'; |
||||
|
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\oci; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group oci |
||||
*/ |
||||
class ConnectionTest extends \yiiunit\framework\db\ConnectionTest |
||||
{ |
||||
protected $driverName = 'oci'; |
||||
} |
@ -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'; |
||||
} |
@ -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'; |
||||
|
@ -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'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\pgsql; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group pgsql |
||||
*/ |
||||
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest |
||||
{ |
||||
public $driverName = 'pgsql'; |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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'; |
||||
|
@ -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'; |
||||
|
@ -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'; |
||||
} |
@ -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'; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\framework\db\sqlite; |
||||
|
||||
/** |
||||
* @group db |
||||
* @group sqlite |
||||
*/ |
||||
class BatchQueryResultTest extends \yiiunit\framework\db\BatchQueryResultTest |
||||
{ |
||||
public $driverName = 'sqlite'; |
||||
} |
@ -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'; |
||||
|
@ -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…
Reference in new issue