Commit d6ff097c by Carsten Brandt

avoid hanging test on bindValue problems (close db connection in tearDown)

parent 825258ef
<?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
......
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