Skip to content

Commit

Permalink
Fixing failing tests and issues with Sqlite.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 3, 2011
1 parent d24c408 commit 2c21fc9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/Cake/Model/Datasource/Database/Sqlite.php
Expand Up @@ -290,6 +290,10 @@ public function resultSet($results) {
$selects = array('seqno', 'cid', 'name');
}
while ($j < $num_fields) {
if (!isset($selects[$j])) {
$j++;
continue;
}
if (preg_match('/\bAS\s+(.*)/i', $selects[$j], $matches)) {
$columnName = trim($matches[1],'"');
} else {
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
Expand Up @@ -615,6 +615,7 @@ public function testCacheMethod() {
/**
* testLog method
*
* @outputBuffering enabled
* @return void
*/
public function testLog() {
Expand Down
9 changes: 2 additions & 7 deletions lib/Cake/Test/Case/Model/ModelReadTest.php
Expand Up @@ -345,17 +345,15 @@ public function testParameterMismatch() {
$query .= ' WHERE ' . $this->db->fullTableName('articles');
$query .= '.published = ? AND ' . $this->db->fullTableName('articles') . '.user_id = ?';
$params = array('Y');
$this->expectError();

ob_start();
$result = $Article->query($query, $params);
ob_end_clean();
$this->assertEqual($result, null);
$this->assertEmpty($result);
}

/**
* testVeryStrangeUseCase method
*
* @expectedException PDOException
* @return void
*/
public function testVeryStrangeUseCase() {
Expand All @@ -368,11 +366,8 @@ public function testVeryStrangeUseCase() {
$this->db->fullTableName('articles') . '.user_id', '3',
$this->db->fullTableName('articles') . '.published', 'Y'
);
$this->expectError();

ob_start();
$result = $Article->query($query, $param);
ob_end_clean();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
Expand Up @@ -181,7 +181,10 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
public function setUp() {
$this->criticDb = $this->getMock('DboSource');
$methods = array_diff(get_class_methods('DboSource'), array('enabled'));
$methods[] = 'connect';

$this->criticDb = $this->getMock('DboSource', $methods);
$this->criticDb->fullDebug = true;
$this->db = ConnectionManager::getDataSource('test');
$this->_backupConfig = $this->db->config;
Expand Down

0 comments on commit 2c21fc9

Please sign in to comment.