ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilCacheTest Class Reference

Unit tests for data cache. More...

+ Inheritance diagram for ilCacheTest:
+ Collaboration diagram for ilCacheTest:

Public Member Functions

 testCache ()
 Cache tests @group IL_Init. More...
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = FALSE
 

Detailed Description

Unit tests for data cache.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 33 of file ilCacheTest.php.

Member Function Documentation

◆ setUp()

ilCacheTest::setUp ( )
protected

Definition at line 37 of file ilCacheTest.php.

38 {
39 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
40 ilUnitUtil::performInitialisation();
41 }

◆ testCache()

ilCacheTest::testCache ( )

Cache tests @group IL_Init.

Parameters

return

Definition at line 49 of file ilCacheTest.php.

50 {
51 include_once './Services/Cache/classes/class.ilExampleCache.php';
52
53 $cache = new ilExampleCache();
54 $get = $cache->getEntry("test_id");
55 $stat = $cache->getLastAccessStatus();
56 $value.= $stat."-".$get."-";
57
58 $get = $cache->storeEntry("test_id", "test_value");
59 $get = $cache->getEntry("test_id");
60 $stat = $cache->getLastAccessStatus();
61 $value.= $stat."-".$get."-";
62
63 sleep(6);
64
65 $get = $cache->getEntry("test_id");
66 $stat = $cache->getLastAccessStatus();
67 $value.= $stat."-".$get."-";
68
69 $this->assertEquals("miss--hit-test_value-miss--", $value);
70 }
Example cache class.

Field Documentation

◆ $backupGlobals

ilCacheTest::$backupGlobals = FALSE
protected

Definition at line 35 of file ilCacheTest.php.


The documentation for this class was generated from the following file: