Commit f2e57b2e by Qiang Xue

Fixed test breaks.

parent 12c48d1a
......@@ -33,6 +33,12 @@ class BarBehavior extends Behavior
class BehaviorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testAttachAndAccessing()
{
$bar = new BarClass();
......
......@@ -27,6 +27,7 @@ class ComponentTest extends TestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$this->component = new NewComponent();
}
......
......@@ -12,6 +12,12 @@ use yiiunit\data\base\InvalidRulesModel;
*/
class ModelTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testGetAttributeLabel()
{
$speaker = new Speaker();
......
......@@ -17,6 +17,7 @@ class ObjectTest extends TestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$this->object = new NewObject;
}
......
......@@ -20,6 +20,7 @@ class AssetControllerTest extends TestCase
public function setUp()
{
$this->mockApplication();
$this->testFilePath = Yii::getAlias('@yiiunit/runtime') . DIRECTORY_SEPARATOR . get_class($this);
$this->createDir($this->testFilePath);
$this->testAssetsBasePath = $this->testFilePath . DIRECTORY_SEPARATOR . 'assets';
......
......@@ -14,6 +14,7 @@ class ActiveRecordTest extends DatabaseTestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}
......
......@@ -9,6 +9,12 @@ use yii\db\DataReader;
class CommandTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
function testConstruct()
{
$db = $this->getConnection(false);
......
......@@ -6,6 +6,12 @@ use yii\db\Connection;
class ConnectionTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
function testConstruct()
{
$connection = $this->getConnection(false);
......
......@@ -12,6 +12,7 @@ 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;
......
......@@ -11,6 +11,11 @@ use yii\db\pgsql\QueryBuilder as PgsqlQueryBuilder;
class QueryBuilderTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
/**
* @throws \Exception
......
......@@ -9,6 +9,12 @@ use yii\db\DataReader;
class QueryTest extends DatabaseTestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
function testSelect()
{
// default
......
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