Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Only skip tests when a connection is needed.
Many tests don't require a connection so we can run those when
Datasource.test is anything.
  • Loading branch information
markstory committed Mar 31, 2013
1 parent 16bc093 commit 3448950
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -28,12 +28,11 @@
class MysqlTest extends \Cake\TestSuite\TestCase {

/**
* setUp
* Helper method for skipping tests that need a real connection.
*
* @return void
*/
public function setUp() {
parent::setUp();
protected function _needsConnection() {
$config = Configure::read('Datasource.test');
$this->skipIf(strpos($config['datasource'], 'Mysql') === false, 'Not using Mysql for test config');
}
Expand Down Expand Up @@ -110,6 +109,7 @@ public function testConnectionConfigCustom() {
* @return void
*/
protected function _createTables($connection) {
$this->_needsConnection();
$connection->execute('DROP TABLE IF EXISTS articles');
$connection->execute('DROP TABLE IF EXISTS authors');

Expand Down

0 comments on commit 3448950

Please sign in to comment.