Skip to content

Commit

Permalink
Improving migration of DboMysqlTest to phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 10, 2010
1 parent a8328f3 commit b3d9de1
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
Expand Up @@ -167,21 +167,17 @@ class DboMysqlTest extends CakeTestCase {
*/
public $Dbo = null;

/**
* Skip if cannot connect to mysql
*
*/
public function skip() {
$this->_initDb();
$this->skipUnless($this->Dbo->config['driver'] == 'mysql', '%s MySQL connection not available');
}

/**
* Sets up a Dbo class instance for testing
*
*/
public function startTest() {
public function setUp() {
$this->Dbo = ConnectionManager::getDataSource('test_suite');
if ($this->Dbo->config['driver'] !== 'mysql') {
$this->markTestSkipped('The MySQL extension is not available.');
}
$this->_debug = Configure::read('debug');
Configure::write('debug', 1);
$this->model = new MysqlTestModel();
}

Expand All @@ -192,24 +188,6 @@ public function startTest() {
public function tearDown() {
unset($this->model);
ClassRegistry::flush();
}

/**
* startCase
*
* @return void
*/
function startCase() {
$this->_debug = Configure::read('debug');
Configure::write('debug', 1);
}

/**
* endCase
*
* @return void
*/
function endCase() {
Configure::write('debug', $this->_debug);
}

Expand Down

0 comments on commit b3d9de1

Please sign in to comment.