Browse Source

Fixed test breaks.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
f2e57b2eec
  1. 6
      tests/unit/framework/base/BehaviorTest.php
  2. 1
      tests/unit/framework/base/ComponentTest.php
  3. 6
      tests/unit/framework/base/ModelTest.php
  4. 1
      tests/unit/framework/base/ObjectTest.php
  5. 1
      tests/unit/framework/console/controllers/AssetControllerTest.php
  6. 1
      tests/unit/framework/db/ActiveRecordTest.php
  7. 6
      tests/unit/framework/db/CommandTest.php
  8. 6
      tests/unit/framework/db/ConnectionTest.php
  9. 1
      tests/unit/framework/db/DatabaseTestCase.php
  10. 5
      tests/unit/framework/db/QueryBuilderTest.php
  11. 6
      tests/unit/framework/db/QueryTest.php

6
tests/unit/framework/base/BehaviorTest.php

@ -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();

1
tests/unit/framework/base/ComponentTest.php

@ -27,6 +27,7 @@ class ComponentTest extends TestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$this->component = new NewComponent();
}

6
tests/unit/framework/base/ModelTest.php

@ -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();

1
tests/unit/framework/base/ObjectTest.php

@ -17,6 +17,7 @@ class ObjectTest extends TestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$this->object = new NewObject;
}

1
tests/unit/framework/console/controllers/AssetControllerTest.php

@ -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';

1
tests/unit/framework/db/ActiveRecordTest.php

@ -14,6 +14,7 @@ class ActiveRecordTest extends DatabaseTestCase
protected function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}

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

@ -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
tests/unit/framework/db/ConnectionTest.php

@ -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);

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

@ -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;

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

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

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

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

Loading…
Cancel
Save