Skip to content

Commit

Permalink
Merge pull request #421 from shadlaws/fixes_20130618_4
Browse files Browse the repository at this point in the history
Add Session_Database override to gallery_unittest - unit tests work agai...
  • Loading branch information
shadlaws committed Jun 18, 2013
2 parents a6bb58a + 06275c7 commit 524914f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Expand Up @@ -54,6 +54,7 @@ public function action_index() {
$db_config["default"]["connection"]["database"] .= "_test";
$db = Database::instance();
ORM::reinitialize();
Session::instance()->reconnect_db();

try {
// Clean out the database
Expand Down
@@ -0,0 +1,24 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2013 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class GalleryUnittest_Session_Database extends Kohana_Session_Database {
public function reconnect_db() {
$this->_db = Database::instance();
}
}
3 changes: 3 additions & 0 deletions modules/gallery_unittest/classes/Session/Database.php
@@ -0,0 +1,3 @@
<?php defined("SYSPATH") or die("No direct script access.");

class Session_Database extends GalleryUnittest_Session_Database {}

0 comments on commit 524914f

Please sign in to comment.