|
|
@ -1,12 +1,16 @@ |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
namespace yiiunit\framework\db; |
|
|
|
namespace yiiunit\framework\db; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use yii\db\Connection; |
|
|
|
use yiiunit\TestCase as TestCase; |
|
|
|
use yiiunit\TestCase as TestCase; |
|
|
|
|
|
|
|
|
|
|
|
abstract class DatabaseTestCase extends TestCase |
|
|
|
abstract class DatabaseTestCase extends TestCase |
|
|
|
{ |
|
|
|
{ |
|
|
|
protected $database; |
|
|
|
protected $database; |
|
|
|
protected $driverName = 'mysql'; |
|
|
|
protected $driverName = 'mysql'; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @var Connection |
|
|
|
|
|
|
|
*/ |
|
|
|
protected $db; |
|
|
|
protected $db; |
|
|
|
|
|
|
|
|
|
|
|
protected function setUp() |
|
|
|
protected function setUp() |
|
|
@ -22,6 +26,13 @@ abstract class DatabaseTestCase extends TestCase |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function tearDown() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if ($this->db) { |
|
|
|
|
|
|
|
$this->db->close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param bool $reset whether to clean up the test database |
|
|
|
* @param bool $reset whether to clean up the test database |
|
|
|
* @param bool $open whether to open and populate test database |
|
|
|
* @param bool $open whether to open and populate test database |
|
|
|