fixed constructor overriding in test classes

now use setUp() instead
This commit is contained in:
Carsten Brandt
2013-03-29 01:10:03 +01:00
parent 9923888637
commit 4d59587320
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ namespace yiiunit;
class MysqlTestCase extends TestCase class MysqlTestCase extends TestCase
{ {
function __construct() protected function setUp()
{ {
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) { if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) {
$this->markTestSkipped('pdo and pdo_mysql extensions are required.'); $this->markTestSkipped('pdo and pdo_mysql extensions are required.');
@ -15,7 +15,7 @@ class MysqlTestCase extends TestCase
* @param bool $reset whether to clean up the test database * @param bool $reset whether to clean up the test database
* @return \yii\db\Connection * @return \yii\db\Connection
*/ */
function getConnection($reset = true) public function getConnection($reset = true)
{ {
$params = $this->getParam('mysql'); $params = $this->getParam('mysql');
$db = new \yii\db\Connection; $db = new \yii\db\Connection;

View File

@ -11,7 +11,7 @@ class DbCacheTest extends CacheTest
private $_cacheInstance; private $_cacheInstance;
private $_connection; private $_connection;
function __construct() protected function setUp()
{ {
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) { if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) {
$this->markTestSkipped('pdo and pdo_mysql extensions are required.'); $this->markTestSkipped('pdo and pdo_mysql extensions are required.');