Skip to content

Commit

Permalink
Changed the test setup to not run the test if test db config is not m…
Browse files Browse the repository at this point in the history
…ssql.
  • Loading branch information
jrbasso committed May 6, 2011
1 parent 9dfc7d6 commit 8b78507
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/Cake/tests/Case/Model/Datasource/Database/MssqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,6 @@ class MssqlTest extends CakeTestCase {
* @access public
*/
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
Expand All @@ -319,8 +311,11 @@ public function end() {
*
*/
public function setUp() {
$db = ConnectionManager::getDataSource('test');
$this->db = new MssqlTestDb($db->config);
$this->Dbo = ConnectionManager::getDataSource('test');
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();
}

Expand Down

0 comments on commit 8b78507

Please sign in to comment.