|
|
|
@ -1,12 +1,16 @@
|
|
|
|
|
<?php |
|
|
|
|
namespace yiiunit\framework\db; |
|
|
|
|
|
|
|
|
|
use yii\db\Connection; |
|
|
|
|
use yiiunit\TestCase as TestCase; |
|
|
|
|
|
|
|
|
|
abstract class DatabaseTestCase extends TestCase |
|
|
|
|
{ |
|
|
|
|
protected $database; |
|
|
|
|
protected $driverName = 'mysql'; |
|
|
|
|
/** |
|
|
|
|
* @var Connection |
|
|
|
|
*/ |
|
|
|
|
protected $db; |
|
|
|
|
|
|
|
|
|
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 $open whether to open and populate test database |
|
|
|
|