diff --git a/tests/unit/framework/db/DatabaseTestCase.php b/tests/unit/framework/db/DatabaseTestCase.php index 54316c7..8ef1234 100644 --- a/tests/unit/framework/db/DatabaseTestCase.php +++ b/tests/unit/framework/db/DatabaseTestCase.php @@ -12,7 +12,6 @@ abstract class DatabaseTestCase extends TestCase * @var Connection */ protected $db; - protected $initializeAppWithDb = false; protected function setUp() { @@ -24,9 +23,6 @@ abstract class DatabaseTestCase extends TestCase if (!extension_loaded('pdo') || !extension_loaded($pdo_database)) { $this->markTestSkipped('pdo and '.$pdo_database.' extension are required.'); } - if ($this->initializeAppWithDb === true) { - \Yii::$app->setComponent('db', $this->getConnection()); - } $this->mockApplication(); } diff --git a/tests/unit/framework/validators/ExistValidatorTest.php b/tests/unit/framework/validators/ExistValidatorTest.php index 40d0935..ea81931 100644 --- a/tests/unit/framework/validators/ExistValidatorTest.php +++ b/tests/unit/framework/validators/ExistValidatorTest.php @@ -19,12 +19,7 @@ class ExistValidatorTest extends DatabaseTestCase public function setUp() { parent::setUp(); - ActiveRecord::$db = Yii::$app->getComponent('db'); - } - - public function tearDown() - { - parent::tearDown(); + ActiveRecord::$db = $this->getConnection(); } public function testValidateValueExpectedException() diff --git a/tests/unit/framework/validators/UniqueValidatorTest.php b/tests/unit/framework/validators/UniqueValidatorTest.php index b0d3554..1142fe0 100644 --- a/tests/unit/framework/validators/UniqueValidatorTest.php +++ b/tests/unit/framework/validators/UniqueValidatorTest.php @@ -20,7 +20,7 @@ class UniqueValidatorTest extends DatabaseTestCase public function setUp() { parent::setUp(); - ActiveRecord::$db = Yii::$app->getComponent('db'); + ActiveRecord::$db = $this->getConnection(); } public function testAssureMessageSetOnInit()