Merge pull request #12506 from bancer/dbosource-missing-methods

Add missing method definitions
This commit is contained in:
Mark Story 2018-08-26 00:12:28 -04:00 committed by GitHub
commit bfdab3d11d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View file

@ -765,10 +765,10 @@ class Postgres extends DboSource {
/** /**
* resultSet method * resultSet method
* *
* @param array &$results The results * @param PDOStatement $results The results
* @return void * @return void
*/ */
public function resultSet(&$results) { public function resultSet($results) {
$this->map = array(); $this->map = array();
$numFields = $results->columnCount(); $numFields = $results->columnCount();
$index = 0; $index = 0;

View file

@ -299,7 +299,7 @@ class Sqlite extends DboSource {
/** /**
* Generate ResultSet * Generate ResultSet
* *
* @param mixed $results The results to modify. * @param PDOStatement $results The results to modify.
* @return void * @return void
*/ */
public function resultSet($results) { public function resultSet($results) {

View file

@ -272,6 +272,16 @@ class DboSource extends DataSource {
} }
} }
/**
* Connects to the database.
*
* @return bool
*/
public function connect() {
// This method is implemented in subclasses
return $this->connected;
}
/** /**
* Reconnects to database server with optional new settings * Reconnects to database server with optional new settings
* *
@ -619,6 +629,16 @@ class DboSource extends DataSource {
} }
} }
/**
* Builds a map of the columns contained in a result
*
* @param PDOStatement $results The results to format.
* @return void
*/
public function resultSet($results) {
// This method is implemented in subclasses
}
/** /**
* Returns a row from current resultset as an array * Returns a row from current resultset as an array
* *

View file

@ -231,7 +231,6 @@ class CakeTestFixtureTest extends CakeTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$methods = array_diff(get_class_methods('DboSource'), array('enabled')); $methods = array_diff(get_class_methods('DboSource'), array('enabled'));
$methods[] = 'connect';
$this->criticDb = $this->getMock('DboSource', $methods); $this->criticDb = $this->getMock('DboSource', $methods);
$this->criticDb->fullDebug = true; $this->criticDb->fullDebug = true;