Commit 544e412a by Carsten Brandt

unit test cleanup

parent e996f3df
......@@ -9,12 +9,6 @@ use yii\db\DataReader;
class CommandTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testConstruct()
{
$db = $this->getConnection(false);
......
......@@ -6,12 +6,6 @@ use yii\db\Connection;
class ConnectionTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testConstruct()
{
$connection = $this->getConnection(false);
......
......@@ -16,7 +16,6 @@ abstract class DatabaseTestCase extends TestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$databases = $this->getParam('databases');
$this->database = $databases[$this->driverName];
$pdo_database = 'pdo_'.$this->driverName;
......@@ -24,6 +23,7 @@ abstract class DatabaseTestCase extends TestCase
if (!extension_loaded('pdo') || !extension_loaded($pdo_database)) {
$this->markTestSkipped('pdo and pdo_'.$pdo_database.' extension are required.');
}
$this->mockApplication();
}
protected function tearDown()
......@@ -31,6 +31,7 @@ abstract class DatabaseTestCase extends TestCase
if ($this->db) {
$this->db->close();
}
$this->destroyApplication();
}
/**
......
......@@ -12,12 +12,6 @@ use yii\db\cubrid\QueryBuilder as CubridQueryBuilder;
class QueryBuilderTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
/**
* @throws \Exception
* @return QueryBuilder
......
......@@ -9,12 +9,6 @@ use yii\db\DataReader;
class QueryTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testSelect()
{
// default
......
......@@ -5,9 +5,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class CubridActiveRecordTest extends ActiveRecordTest
{
protected function setUp()
{
$this->driverName = 'cubrid';
parent::setUp();
}
public $driverName = 'cubrid';
}
......@@ -5,11 +5,7 @@ use yiiunit\framework\db\CommandTest;
class CubridCommandTest extends CommandTest
{
protected function setUp()
{
$this->driverName = 'cubrid';
parent::setUp();
}
public $driverName = 'cubrid';
public function testBindParamValue()
{
......
......@@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class CubridConnectionTest extends ConnectionTest
{
protected function setUp()
{
$this->driverName = 'cubrid';
parent::setUp();
}
public $driverName = 'cubrid';
public function testQuoteValue()
{
......
......@@ -5,9 +5,5 @@ use yiiunit\framework\db\QueryTest;
class CubridQueryTest extends QueryTest
{
protected function setUp()
{
$this->driverName = 'cubrid';
parent::setUp();
}
public $driverName = 'cubrid';
}
......@@ -6,9 +6,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class MssqlActiveRecordTest extends ActiveRecordTest
{
protected function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
protected $driverName = 'sqlsrv';
}
......@@ -6,11 +6,7 @@ use yiiunit\framework\db\CommandTest;
class MssqlCommandTest extends CommandTest
{
public function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
protected $driverName = 'sqlsrv';
public function testAutoQuoting()
{
......
......@@ -6,11 +6,7 @@ use yiiunit\framework\db\ConnectionTest;
class MssqlConnectionTest extends ConnectionTest
{
public function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
protected $driverName = 'sqlsrv';
public function testQuoteValue()
{
......
......@@ -6,9 +6,5 @@ use yiiunit\framework\db\QueryTest;
class MssqlQueryTest extends QueryTest
{
public function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
protected $driverName = 'sqlsrv';
}
......@@ -6,9 +6,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class PostgreSQLActiveRecordTest extends ActiveRecordTest
{
protected function setUp()
{
$this->driverName = 'pgsql';
parent::setUp();
}
protected $driverName = 'pgsql';
}
......@@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class PostgreSQLConnectionTest extends ConnectionTest
{
public function setUp()
{
$this->driverName = 'pgsql';
parent::setUp();
}
protected $driverName = 'pgsql';
public function testConnection()
{
......
......@@ -2,13 +2,11 @@
namespace yiiunit\framework\db\pgsql;
use yii\base\NotSupportedException;
use yii\db\pgsql\Schema;
use yiiunit\framework\db\QueryBuilderTest;
class PostgreSQLQueryBuilderTest extends QueryBuilderTest
{
public $driverName = 'pgsql';
public function columnTypes()
......
......@@ -5,9 +5,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class SqliteActiveRecordTest extends ActiveRecordTest
{
protected function setUp()
{
$this->driverName = 'sqlite';
parent::setUp();
}
protected $driverName = 'sqlite';
}
......@@ -5,11 +5,7 @@ use yiiunit\framework\db\CommandTest;
class SqliteCommandTest extends CommandTest
{
protected function setUp()
{
$this->driverName = 'sqlite';
parent::setUp();
}
protected $driverName = 'sqlite';
public function testAutoQuoting()
{
......
......@@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class SqliteConnectionTest extends ConnectionTest
{
protected function setUp()
{
$this->driverName = 'sqlite';
parent::setUp();
}
protected $driverName = 'sqlite';
public function testConstruct()
{
......
......@@ -8,7 +8,7 @@ use yiiunit\framework\db\QueryBuilderTest;
class SqliteQueryBuilderTest extends QueryBuilderTest
{
public $driverName = 'sqlite';
protected $driverName = 'sqlite';
public function columnTypes()
{
......
......@@ -5,9 +5,5 @@ use yiiunit\framework\db\QueryTest;
class SqliteQueryTest extends QueryTest
{
protected function setUp()
{
$this->driverName = 'sqlite';
parent::setUp();
}
protected $driverName = 'sqlite';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment