Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Jose Lorenzo Rodriguez 2011-09-03 17:01:49 -04:30
commit 0ca8af2c22
4 changed files with 11 additions and 8 deletions

View file

@ -290,6 +290,10 @@ class Sqlite extends DboSource {
$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 {

View file

@ -615,6 +615,7 @@ class DboSourceTest extends CakeTestCase {
/**
* testLog method
*
* @outputBuffering enabled
* @return void
*/
public function testLog() {

View file

@ -345,17 +345,15 @@ class ModelReadTest extends BaseModelTest {
$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() {
@ -368,11 +366,8 @@ class ModelReadTest extends BaseModelTest {
$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();
}
/**

View file

@ -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;