Changed the test setup to not run the test if test db config is not mssql.

This commit is contained in:
Juan Basso 2011-04-29 09:14:09 -04:00
parent 9dfc7d6593
commit 8b78507b3d

View file

@ -287,14 +287,6 @@ class MssqlTest extends CakeTestCase {
* @access public * @access public
*/ */
public $fixtures = array('core.category'); public $fixtures = array('core.category');
/**
* Skip if cannot connect to mssql
*
*/
public function skip() {
$this->_initDb();
$this->skipUnless($this->db->config['driver'] == 'mssql', '%s SQL Server connection not available');
}
/** /**
* Make sure all fixtures tables are being created * Make sure all fixtures tables are being created
@ -319,8 +311,11 @@ class MssqlTest extends CakeTestCase {
* *
*/ */
public function setUp() { public function setUp() {
$db = ConnectionManager::getDataSource('test'); $this->Dbo = ConnectionManager::getDataSource('test');
$this->db = new MssqlTestDb($db->config); if (!($this->Dbo instanceof Mssql)) {
$this->markTestSkipped('Please configure the test datasource to use SQL Server.');
}
$this->db = new MssqlTestDb($this->Dbo->config);
$this->model = new MssqlTestModel(); $this->model = new MssqlTestModel();
} }