* Copyright 2001-2010 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/Prefs.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 */ require_once 'PHPUnit.php'; class PrefsTest extends PHPUnit_TestCase { var $Prefs; function PrefsTest($name) { $this->PHPUnit_TestCase($name); } function setUp() { require dirname(__FILE__) . '/_config.inc.php'; require_once '../lib/Prefs.inc.php'; $this->Prefs =& new Prefs(PARAM); } function tearDown() { unset($this->Prefs); } function test_setdefault() { $result = $this->Prefs->setdefault(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_setvalue() { $result = $this->Prefs->setvalue(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getue() { $result = $this->Prefs->getue(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_exists() { $result = $this->Prefs->exists(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_clearvalue() { $result = $this->Prefs->clearvalue(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_retrieve() { $result = $this->Prefs->retrieve(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_store() { $result = $this->Prefs->store(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_cleanup() { $result = $this->Prefs->cleanup(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } } // Running the test. $suite = new PHPUnit_TestSuite('PrefsTest'); $result = PHPUnit::run($suite); echo $result->toString(); ?>