PHPUnit_TestCase($name); } function setUp() { require dirname(__FILE__) . '/_config.inc.php'; require_once '../lib/DBSessionHandler.inc.php'; session_write_close(); $this->DBSessionHandler = new DBSessionHandler($app->db); $this->DBSessionHandler = new DBSessionHandler(null, array( 'db_server' => $app->getParam('db_server'), 'db_name' => $app->getParam('db_name'), 'db_user' => $app->getParam('db_user'), 'db_pass' => $app->getParam('db_pass'), 'db_always_debug' => $app->getParam('db_always_debug'), 'db_debug' => $app->getParam('db_debug'), 'db_die_on_failure' => $app->getParam('db_die_on_failure'), )); } 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() { $this->DBSessionHandler->DBsessionwrite(session_id(), serialize($_SESSION)); } function test_DBsessiondestroy() { $this->DBSessionHandler->DBsessiondestroy(session_id()); } function test_DBsessiongarbage() { $this->DBSessionHandler->DBsessiongarbage(0); } } // Running the test. $suite = new PHPUnit_TestSuite('DBSessionHandlerTest'); $result = PHPUnit::run($suite); echo $result->toString(); ?>