Browse Source

unit test cleanup

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
544e412af8
  1. 6
      tests/unit/framework/db/CommandTest.php
  2. 6
      tests/unit/framework/db/ConnectionTest.php
  3. 3
      tests/unit/framework/db/DatabaseTestCase.php
  4. 6
      tests/unit/framework/db/QueryBuilderTest.php
  5. 6
      tests/unit/framework/db/QueryTest.php
  6. 6
      tests/unit/framework/db/cubrid/CubridActiveRecordTest.php
  7. 6
      tests/unit/framework/db/cubrid/CubridCommandTest.php
  8. 6
      tests/unit/framework/db/cubrid/CubridConnectionTest.php
  9. 6
      tests/unit/framework/db/cubrid/CubridQueryTest.php
  10. 6
      tests/unit/framework/db/mssql/MssqlActiveRecordTest.php
  11. 6
      tests/unit/framework/db/mssql/MssqlCommandTest.php
  12. 6
      tests/unit/framework/db/mssql/MssqlConnectionTest.php
  13. 6
      tests/unit/framework/db/mssql/MssqlQueryTest.php
  14. 6
      tests/unit/framework/db/pgsql/PostgreSQLActiveRecordTest.php
  15. 6
      tests/unit/framework/db/pgsql/PostgreSQLConnectionTest.php
  16. 2
      tests/unit/framework/db/pgsql/PostgreSQLQueryBuilderTest.php
  17. 6
      tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
  18. 6
      tests/unit/framework/db/sqlite/SqliteCommandTest.php
  19. 6
      tests/unit/framework/db/sqlite/SqliteConnectionTest.php
  20. 2
      tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php
  21. 6
      tests/unit/framework/db/sqlite/SqliteQueryTest.php

6
tests/unit/framework/db/CommandTest.php

@ -9,12 +9,6 @@ use yii\db\DataReader;
class CommandTest extends DatabaseTestCase class CommandTest extends DatabaseTestCase
{ {
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testConstruct() public function testConstruct()
{ {
$db = $this->getConnection(false); $db = $this->getConnection(false);

6
tests/unit/framework/db/ConnectionTest.php

@ -6,12 +6,6 @@ use yii\db\Connection;
class ConnectionTest extends DatabaseTestCase class ConnectionTest extends DatabaseTestCase
{ {
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testConstruct() public function testConstruct()
{ {
$connection = $this->getConnection(false); $connection = $this->getConnection(false);

3
tests/unit/framework/db/DatabaseTestCase.php

@ -16,7 +16,6 @@ abstract class DatabaseTestCase extends TestCase
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();
$this->mockApplication();
$databases = $this->getParam('databases'); $databases = $this->getParam('databases');
$this->database = $databases[$this->driverName]; $this->database = $databases[$this->driverName];
$pdo_database = 'pdo_'.$this->driverName; $pdo_database = 'pdo_'.$this->driverName;
@ -24,6 +23,7 @@ abstract class DatabaseTestCase extends TestCase
if (!extension_loaded('pdo') || !extension_loaded($pdo_database)) { if (!extension_loaded('pdo') || !extension_loaded($pdo_database)) {
$this->markTestSkipped('pdo and pdo_'.$pdo_database.' extension are required.'); $this->markTestSkipped('pdo and pdo_'.$pdo_database.' extension are required.');
} }
$this->mockApplication();
} }
protected function tearDown() protected function tearDown()
@ -31,6 +31,7 @@ abstract class DatabaseTestCase extends TestCase
if ($this->db) { if ($this->db) {
$this->db->close(); $this->db->close();
} }
$this->destroyApplication();
} }
/** /**

6
tests/unit/framework/db/QueryBuilderTest.php

@ -12,12 +12,6 @@ use yii\db\cubrid\QueryBuilder as CubridQueryBuilder;
class QueryBuilderTest extends DatabaseTestCase class QueryBuilderTest extends DatabaseTestCase
{ {
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
/** /**
* @throws \Exception * @throws \Exception
* @return QueryBuilder * @return QueryBuilder

6
tests/unit/framework/db/QueryTest.php

@ -9,12 +9,6 @@ use yii\db\DataReader;
class QueryTest extends DatabaseTestCase class QueryTest extends DatabaseTestCase
{ {
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testSelect() public function testSelect()
{ {
// default // default

6
tests/unit/framework/db/cubrid/CubridActiveRecordTest.php

@ -5,9 +5,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class CubridActiveRecordTest extends ActiveRecordTest class CubridActiveRecordTest extends ActiveRecordTest
{ {
protected function setUp() public $driverName = 'cubrid';
{
$this->driverName = 'cubrid';
parent::setUp();
}
} }

6
tests/unit/framework/db/cubrid/CubridCommandTest.php

@ -5,11 +5,7 @@ use yiiunit\framework\db\CommandTest;
class CubridCommandTest extends CommandTest class CubridCommandTest extends CommandTest
{ {
protected function setUp() public $driverName = 'cubrid';
{
$this->driverName = 'cubrid';
parent::setUp();
}
public function testBindParamValue() public function testBindParamValue()
{ {

6
tests/unit/framework/db/cubrid/CubridConnectionTest.php

@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class CubridConnectionTest extends ConnectionTest class CubridConnectionTest extends ConnectionTest
{ {
protected function setUp() public $driverName = 'cubrid';
{
$this->driverName = 'cubrid';
parent::setUp();
}
public function testQuoteValue() public function testQuoteValue()
{ {

6
tests/unit/framework/db/cubrid/CubridQueryTest.php

@ -5,9 +5,5 @@ use yiiunit\framework\db\QueryTest;
class CubridQueryTest extends QueryTest class CubridQueryTest extends QueryTest
{ {
protected function setUp() public $driverName = 'cubrid';
{
$this->driverName = 'cubrid';
parent::setUp();
}
} }

6
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php

@ -6,9 +6,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class MssqlActiveRecordTest extends ActiveRecordTest class MssqlActiveRecordTest extends ActiveRecordTest
{ {
protected function setUp() protected $driverName = 'sqlsrv';
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
} }

6
tests/unit/framework/db/mssql/MssqlCommandTest.php

@ -6,11 +6,7 @@ use yiiunit\framework\db\CommandTest;
class MssqlCommandTest extends CommandTest class MssqlCommandTest extends CommandTest
{ {
public function setUp() protected $driverName = 'sqlsrv';
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
public function testAutoQuoting() public function testAutoQuoting()
{ {

6
tests/unit/framework/db/mssql/MssqlConnectionTest.php

@ -6,11 +6,7 @@ use yiiunit\framework\db\ConnectionTest;
class MssqlConnectionTest extends ConnectionTest class MssqlConnectionTest extends ConnectionTest
{ {
public function setUp() protected $driverName = 'sqlsrv';
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
public function testQuoteValue() public function testQuoteValue()
{ {

6
tests/unit/framework/db/mssql/MssqlQueryTest.php

@ -6,9 +6,5 @@ use yiiunit\framework\db\QueryTest;
class MssqlQueryTest extends QueryTest class MssqlQueryTest extends QueryTest
{ {
public function setUp() protected $driverName = 'sqlsrv';
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
} }

6
tests/unit/framework/db/pgsql/PostgreSQLActiveRecordTest.php

@ -6,9 +6,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class PostgreSQLActiveRecordTest extends ActiveRecordTest class PostgreSQLActiveRecordTest extends ActiveRecordTest
{ {
protected function setUp() protected $driverName = 'pgsql';
{
$this->driverName = 'pgsql';
parent::setUp();
}
} }

6
tests/unit/framework/db/pgsql/PostgreSQLConnectionTest.php

@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class PostgreSQLConnectionTest extends ConnectionTest class PostgreSQLConnectionTest extends ConnectionTest
{ {
public function setUp() protected $driverName = 'pgsql';
{
$this->driverName = 'pgsql';
parent::setUp();
}
public function testConnection() public function testConnection()
{ {

2
tests/unit/framework/db/pgsql/PostgreSQLQueryBuilderTest.php

@ -2,13 +2,11 @@
namespace yiiunit\framework\db\pgsql; namespace yiiunit\framework\db\pgsql;
use yii\base\NotSupportedException;
use yii\db\pgsql\Schema; use yii\db\pgsql\Schema;
use yiiunit\framework\db\QueryBuilderTest; use yiiunit\framework\db\QueryBuilderTest;
class PostgreSQLQueryBuilderTest extends QueryBuilderTest class PostgreSQLQueryBuilderTest extends QueryBuilderTest
{ {
public $driverName = 'pgsql'; public $driverName = 'pgsql';
public function columnTypes() public function columnTypes()

6
tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php

@ -5,9 +5,5 @@ use yiiunit\framework\db\ActiveRecordTest;
class SqliteActiveRecordTest extends ActiveRecordTest class SqliteActiveRecordTest extends ActiveRecordTest
{ {
protected function setUp() protected $driverName = 'sqlite';
{
$this->driverName = 'sqlite';
parent::setUp();
}
} }

6
tests/unit/framework/db/sqlite/SqliteCommandTest.php

@ -5,11 +5,7 @@ use yiiunit\framework\db\CommandTest;
class SqliteCommandTest extends CommandTest class SqliteCommandTest extends CommandTest
{ {
protected function setUp() protected $driverName = 'sqlite';
{
$this->driverName = 'sqlite';
parent::setUp();
}
public function testAutoQuoting() public function testAutoQuoting()
{ {

6
tests/unit/framework/db/sqlite/SqliteConnectionTest.php

@ -5,11 +5,7 @@ use yiiunit\framework\db\ConnectionTest;
class SqliteConnectionTest extends ConnectionTest class SqliteConnectionTest extends ConnectionTest
{ {
protected function setUp() protected $driverName = 'sqlite';
{
$this->driverName = 'sqlite';
parent::setUp();
}
public function testConstruct() public function testConstruct()
{ {

2
tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php

@ -8,7 +8,7 @@ use yiiunit\framework\db\QueryBuilderTest;
class SqliteQueryBuilderTest extends QueryBuilderTest class SqliteQueryBuilderTest extends QueryBuilderTest
{ {
public $driverName = 'sqlite'; protected $driverName = 'sqlite';
public function columnTypes() public function columnTypes()
{ {

6
tests/unit/framework/db/sqlite/SqliteQueryTest.php

@ -5,9 +5,5 @@ use yiiunit\framework\db\QueryTest;
class SqliteQueryTest extends QueryTest class SqliteQueryTest extends QueryTest
{ {
protected function setUp() protected $driverName = 'sqlite';
{
$this->driverName = 'sqlite';
parent::setUp();
}
} }

Loading…
Cancel
Save