Skip to content

Commit

Permalink
Add Database::set_default_instance() for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 21, 2009
1 parent 287f79d commit 0cd03c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/gallery/libraries/MY_Database.php
Expand Up @@ -57,4 +57,11 @@ public function add_table_prefixes($sql) {

return strtr($sql, $this->_table_names);
}

/**
* This is used by the unit test code to switch the active database connection.
*/
static function set_default_instance($db) {
self::$instances["default"] = $db;
}
}

0 comments on commit 0cd03c8

Please sign in to comment.