Fixing sqlite test case

This commit is contained in:
José Lorenzo Rodríguez 2010-12-22 00:13:26 -04:30
parent 7870fb1ef2
commit 8444510bae

View file

@ -27,7 +27,7 @@ App::uses('Sqlite', 'Model/Datasource/Database');
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboSqliteTestDb extends DboSqlite { class DboSqliteTestDb extends Sqlite {
/** /**
* simulated property * simulated property
@ -99,7 +99,7 @@ class DboSqliteTest extends CakeTestCase {
public function setUp() { public function setUp() {
Configure::write('Cache.disable', true); Configure::write('Cache.disable', true);
$this->Dbo = ConnectionManager::getDataSource('test'); $this->Dbo = ConnectionManager::getDataSource('test');
if ($this->Dbo->config['driver'] !== 'sqlite') { if (!$this->Dbo instanceof Sqlite) {
$this->markTestSkipped('The Sqlite extension is not available.'); $this->markTestSkipped('The Sqlite extension is not available.');
} }
} }
@ -170,7 +170,7 @@ class DboSqliteTest extends CakeTestCase {
$this->assertFalse(file_exists(TMP . $dbName)); $this->assertFalse(file_exists(TMP . $dbName));
$config = $this->Dbo->config; $config = $this->Dbo->config;
$db = new DboSqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName))); $db = new Sqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName)));
$this->assertTrue(file_exists(TMP . $dbName)); $this->assertTrue(file_exists(TMP . $dbName));
$db->execute("CREATE TABLE test_list (id VARCHAR(255));"); $db->execute("CREATE TABLE test_list (id VARCHAR(255));");