[1] | 1 | <?php |
---|
| 2 | /// FIXME: Tests not implemented. |
---|
| 3 | return; |
---|
| 4 | |
---|
| 5 | /** |
---|
[362] | 6 | * The Strangecode Codebase - a general application development framework for PHP |
---|
| 7 | * For details visit the project site: <http://trac.strangecode.com/codebase/> |
---|
[396] | 8 | * Copyright 2001-2012 Strangecode, LLC |
---|
[480] | 9 | * |
---|
[362] | 10 | * This file is part of The Strangecode Codebase. |
---|
[42] | 11 | * |
---|
[362] | 12 | * The Strangecode Codebase is free software: you can redistribute it and/or |
---|
| 13 | * modify it under the terms of the GNU General Public License as published by the |
---|
| 14 | * Free Software Foundation, either version 3 of the License, or (at your option) |
---|
| 15 | * any later version. |
---|
[480] | 16 | * |
---|
[362] | 17 | * The Strangecode Codebase is distributed in the hope that it will be useful, but |
---|
| 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
| 19 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
| 20 | * details. |
---|
[480] | 21 | * |
---|
[362] | 22 | * You should have received a copy of the GNU General Public License along with |
---|
| 23 | * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | /** |
---|
| 27 | * PHPUnit test case for codebase/lib/Prefs.inc.php |
---|
| 28 | * |
---|
[42] | 29 | * The method skeletons below need to be filled in with |
---|
| 30 | * real data so that the tests will run correctly. Replace |
---|
| 31 | * all EXPECTED_VAL and PARAM strings with real data. |
---|
| 32 | * |
---|
[1] | 33 | * Created with PHPUnit_Skeleton on 2005-08-09 |
---|
| 34 | */ |
---|
| 35 | |
---|
[468] | 36 | class PrefsTest extends PHPUnit_Framework_TestCase { |
---|
| 37 | |
---|
[1] | 38 | var $Prefs; |
---|
| 39 | |
---|
| 40 | function PrefsTest($name) |
---|
| 41 | { |
---|
[468] | 42 | $this->PHPUnit_Framework_TestCase($name); |
---|
[1] | 43 | } |
---|
| 44 | |
---|
| 45 | function setUp() |
---|
| 46 | { |
---|
| 47 | require dirname(__FILE__) . '/_config.inc.php'; |
---|
| 48 | require_once '../lib/Prefs.inc.php'; |
---|
[480] | 49 | $prefs = new Prefs('test', array( |
---|
| 50 | 'storagetype' => 'session', |
---|
| 51 | )); |
---|
[1] | 52 | } |
---|
| 53 | |
---|
| 54 | function tearDown() |
---|
| 55 | { |
---|
| 56 | unset($this->Prefs); |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | function test_setdefault() |
---|
| 60 | { |
---|
| 61 | $result = $this->Prefs->setdefault(PARAM); |
---|
| 62 | $expected = EXPECTED_VAL; |
---|
| 63 | $this->assertEquals($expected, $result); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | function test_setvalue() |
---|
| 67 | { |
---|
| 68 | $result = $this->Prefs->setvalue(PARAM); |
---|
| 69 | $expected = EXPECTED_VAL; |
---|
| 70 | $this->assertEquals($expected, $result); |
---|
| 71 | } |
---|
| 72 | |
---|
[149] | 73 | function test_getue() |
---|
[1] | 74 | { |
---|
[149] | 75 | $result = $this->Prefs->getue(PARAM); |
---|
[1] | 76 | $expected = EXPECTED_VAL; |
---|
| 77 | $this->assertEquals($expected, $result); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | function test_exists() |
---|
| 81 | { |
---|
| 82 | $result = $this->Prefs->exists(PARAM); |
---|
| 83 | $expected = EXPECTED_VAL; |
---|
| 84 | $this->assertEquals($expected, $result); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | function test_clearvalue() |
---|
| 88 | { |
---|
| 89 | $result = $this->Prefs->clearvalue(PARAM); |
---|
| 90 | $expected = EXPECTED_VAL; |
---|
| 91 | $this->assertEquals($expected, $result); |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | function test_retrieve() |
---|
| 95 | { |
---|
| 96 | $result = $this->Prefs->retrieve(PARAM); |
---|
| 97 | $expected = EXPECTED_VAL; |
---|
| 98 | $this->assertEquals($expected, $result); |
---|
| 99 | } |
---|
| 100 | |
---|
| 101 | function test_store() |
---|
| 102 | { |
---|
| 103 | $result = $this->Prefs->store(PARAM); |
---|
| 104 | $expected = EXPECTED_VAL; |
---|
| 105 | $this->assertEquals($expected, $result); |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | function test_cleanup() |
---|
| 109 | { |
---|
| 110 | $result = $this->Prefs->cleanup(PARAM); |
---|
| 111 | $expected = EXPECTED_VAL; |
---|
| 112 | $this->assertEquals($expected, $result); |
---|
| 113 | } |
---|
| 114 | |
---|
| 115 | } |
---|