Skip to content
Permalink
Browse files

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 34489502b082aa1199b160f57b197a50350c526f
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Test/TestCase/Model/Datasource/Database/Driver/MysqlTest.php
@@ -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');
}
@@ -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');

0 comments on commit 3448950

Please sign in to comment.
You can’t perform that action at this time.