source: branches/eli_branch/tests/DBSessionHandlerTest.php @ 447

Last change on this file since 447 was 447, checked in by anonymous, 11 years ago

Changed some global constants to class constants (in cases where backwards compatability wouldn't break).

File size: 2.4 KB
Line 
1<?php
2/**
3 * The Strangecode Codebase - a general application development framework for PHP
4 * For details visit the project site: <http://trac.strangecode.com/codebase/>
5 * Copyright 2001-2012 Strangecode, LLC
6 *
7 * This file is part of The Strangecode Codebase.
8 *
9 * The Strangecode Codebase is free software: you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * The Strangecode Codebase is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License along with
20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23/**
24 * PHPUnit test case for codebase/lib/DBSessionHandler.inc.php
25 *
26 * The method skeletons below need to be filled in with
27 * real data so that the tests will run correctly. Replace
28 * all EXPECTED_VAL and PARAM strings with real data.
29 *
30 * Created with PHPUnit_Skeleton on 2005-08-09
31 */
32
33class DBSessionHandlerTest extends PHPUnit_Framework_TestCase {
34
35    var $DBSessionHandler;
36
37    function setUp()
38    {
39        require dirname(__FILE__) . '/_config.inc.php';
40        require_once '../lib/DBSessionHandler.inc.php';
41        session_write_close();
42        $this->DBSessionHandler = new DBSessionHandler($app->db, array(
43            'db_table' => 'session_tbl',
44            'create_table' => true,
45        ));
46    }
47
48    function tearDown()
49    {
50        unset($this->DBSessionHandler);
51    }
52
53    function test_DBsessionopen()
54    {
55        $this->DBSessionHandler->DBsessionopen('', '');
56    }
57
58    function test_DBsessionclose()
59    {
60        $this->DBSessionHandler->DBsessionclose();
61    }
62
63    function test_DBsessionread()
64    {
65        $this->DBSessionHandler->DBsessionread(session_id());
66    }
67
68    function test_DBsessionwrite()
69    {
70        $this->DBSessionHandler->DBsessionwrite(session_id(), serialize($_SESSION));
71    }
72
73    function test_DBsessiondestroy()
74    {
75        $this->DBSessionHandler->DBsessiondestroy(session_id());
76    }
77
78    function test_DBsessiongarbage()
79    {
80        $this->DBSessionHandler->DBsessiongarbage(0);
81    }
82
83}
Note: See TracBrowser for help on using the repository browser.