ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

Definition at line 47 of file ilCacheTest.php.

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