1
0
Fork 0
mirror of https://github.com/Oreolek/yii2-nested-sets.git synced 2024-06-17 07:10:46 +03:00
yii2-nested-sets/tests/DatabaseTestCase.php
2015-01-16 00:52:07 +03:00

45 lines
851 B
PHP

<?php
/**
* @link https://github.com/creocoder/yii2-nested-sets
* @copyright Copyright (c) 2015 Alexander Kochetov
* @license http://opensource.org/licenses/BSD-3-Clause
*/
namespace tests;
use Yii;
/**
* DatabaseTestCase
*/
abstract class DatabaseTestCase extends \PHPUnit_Extensions_Database_TestCase
{
/**
* @inheritdoc
*/
public function getConnection()
{
return $this->createDefaultDBConnection(Yii::$app->getDb()->pdo);
}
/**
* @inheritdoc
*/
public function getDataSet()
{
return $this->createFlatXMLDataSet(__DIR__ . '/data/test.xml');
}
/**
* @inheritdoc
*/
protected function setUp()
{
if (Yii::$app->get('db', false) === null) {
$this->markTestSkipped();
} else {
parent::setUp();
}
}
}