[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 |
---|
[468] | 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. |
---|
[468] | 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. |
---|
[468] | 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/Cache.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 CacheTest extends PHPUnit_Framework_TestCase { |
---|
| 37 | |
---|
[136] | 38 | var $Cache; |
---|
[1] | 39 | |
---|
[136] | 40 | function CacheTest($name) |
---|
[1] | 41 | { |
---|
[468] | 42 | $this->PHPUnit_Framework_TestCase($name); |
---|
[1] | 43 | } |
---|
| 44 | |
---|
| 45 | function setUp() |
---|
| 46 | { |
---|
| 47 | require dirname(__FILE__) . '/_config.inc.php'; |
---|
[136] | 48 | require_once '../lib/Cache.inc.php'; |
---|
| 49 | $this->Cache =& new Cache(PARAM); |
---|
[1] | 50 | } |
---|
| 51 | |
---|
| 52 | function tearDown() |
---|
| 53 | { |
---|
[136] | 54 | unset($this->Cache); |
---|
[1] | 55 | } |
---|
| 56 | |
---|
| 57 | function test_getinstance() |
---|
| 58 | { |
---|
[136] | 59 | $result = $this->Cache->getinstance(PARAM); |
---|
[1] | 60 | $expected = EXPECTED_VAL; |
---|
| 61 | $this->assertEquals($expected, $result); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | function test_setparam() |
---|
| 65 | { |
---|
[136] | 66 | $result = $this->Cache->setparam(PARAM); |
---|
[1] | 67 | $expected = EXPECTED_VAL; |
---|
| 68 | $this->assertEquals($expected, $result); |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | function test_getparam() |
---|
| 72 | { |
---|
[136] | 73 | $result = $this->Cache->getparam(PARAM); |
---|
[1] | 74 | $expected = EXPECTED_VAL; |
---|
| 75 | $this->assertEquals($expected, $result); |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | function test_putcache() |
---|
| 79 | { |
---|
[136] | 80 | $result = $this->Cache->putcache(PARAM); |
---|
[1] | 81 | $expected = EXPECTED_VAL; |
---|
| 82 | $this->assertEquals($expected, $result); |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | function test_getcache() |
---|
| 86 | { |
---|
[136] | 87 | $result = $this->Cache->getcache(PARAM); |
---|
[1] | 88 | $expected = EXPECTED_VAL; |
---|
| 89 | $this->assertEquals($expected, $result); |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | function test_iscached() |
---|
| 93 | { |
---|
[136] | 94 | $result = $this->Cache->iscached(PARAM); |
---|
[1] | 95 | $expected = EXPECTED_VAL; |
---|
| 96 | $this->assertEquals($expected, $result); |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | function test_breakcache() |
---|
| 100 | { |
---|
[136] | 101 | $result = $this->Cache->breakcache(PARAM); |
---|
[1] | 102 | $expected = EXPECTED_VAL; |
---|
| 103 | $this->assertEquals($expected, $result); |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | } |
---|