* Copyright 2001-2012 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase 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 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase 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 * The Strangecode Codebase. If not, see . */ /** * PHPUnit test case for codebase/lib/DBSessionHandler.inc.php * * The method skeletons below need to be filled in with * real data so that the tests will run correctly. Replace * all EXPECTED_VAL and PARAM strings with real data. * * Created with PHPUnit_Skeleton on 2005-08-09 */ class DBSessionHandlerTest extends PHPUnit_Framework_TestCase { var $DBSessionHandler; function setUp() { require dirname(__FILE__) . '/_config.inc.php'; require_once '../lib/DBSessionHandler.inc.php'; session_write_close(); $this->DBSessionHandler = new DBSessionHandler($app->db, array( 'db_table' => 'session_tbl', 'create_table' => true, )); } function tearDown() { unset($this->DBSessionHandler); } function test_DBsessionopen() { $this->DBSessionHandler->DBsessionopen('', ''); } function test_DBsessionclose() { $this->DBSessionHandler->DBsessionclose(); } function test_DBsessionread() { $this->DBSessionHandler->DBsessionread(session_id()); } function test_DBsessionwrite() { if (!isset($_SESSION)) { $_SESSION = array(); } $this->DBSessionHandler->DBsessionwrite(session_id(), serialize($_SESSION)); } function test_DBsessiondestroy() { $this->DBSessionHandler->DBsessiondestroy(session_id()); } function test_DBsessiongarbage() { $this->DBSessionHandler->DBsessiongarbage(0); } }