source: trunk/tests/CacheTest.php @ 137

Last change on this file since 137 was 137, checked in by scdev, 18 years ago

Q - Renamed SessionCache? to Cache, RecordVersion? to Version, and RecordLock? to Lock

File size: 2.0 KB
Line 
1<?php
2/// FIXME: Tests not implemented.
3return;
4
5/**
6 * PHPUnit test case for Cache
7 *
8 * The method skeletons below need to be filled in with
9 * real data so that the tests will run correctly. Replace
10 * all EXPECTED_VAL and PARAM strings with real data.
11 *
12 * Created with PHPUnit_Skeleton on 2005-08-09
13 */
14require_once 'PHPUnit.php';
15class CacheTest extends PHPUnit_TestCase {
16
17    var $Cache;
18
19    function CacheTest($name)
20    {
21        $this->PHPUnit_TestCase($name);
22    }
23
24    function setUp()
25    {
26        require dirname(__FILE__) . '/_config.inc.php';
27        require_once '../lib/Cache.inc.php';
28        $this->Cache =& new Cache(PARAM);
29    }
30
31    function tearDown()
32    {
33        unset($this->Cache);
34    }
35
36    function test_getinstance()
37    {
38        $result = $this->Cache->getinstance(PARAM);
39        $expected = EXPECTED_VAL;
40        $this->assertEquals($expected, $result);
41    }
42
43    function test_setparam()
44    {
45        $result = $this->Cache->setparam(PARAM);
46        $expected = EXPECTED_VAL;
47        $this->assertEquals($expected, $result);
48    }
49
50    function test_getparam()
51    {
52        $result = $this->Cache->getparam(PARAM);
53        $expected = EXPECTED_VAL;
54        $this->assertEquals($expected, $result);
55    }
56
57    function test_putcache()
58    {
59        $result = $this->Cache->putcache(PARAM);
60        $expected = EXPECTED_VAL;
61        $this->assertEquals($expected, $result);
62    }
63
64    function test_getcache()
65    {
66        $result = $this->Cache->getcache(PARAM);
67        $expected = EXPECTED_VAL;
68        $this->assertEquals($expected, $result);
69    }
70
71    function test_iscached()
72    {
73        $result = $this->Cache->iscached(PARAM);
74        $expected = EXPECTED_VAL;
75        $this->assertEquals($expected, $result);
76    }
77
78    function test_breakcache()
79    {
80        $result = $this->Cache->breakcache(PARAM);
81        $expected = EXPECTED_VAL;
82        $this->assertEquals($expected, $result);
83    }
84
85}
86// Running the test.
87$suite = new PHPUnit_TestSuite('CacheTest');
88$result = PHPUnit::run($suite);
89echo $result->toString();
90?>
Note: See TracBrowser for help on using the repository browser.