ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCacheTest Class Reference

Unit tests for data cache. More...

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

Public Member Functions

 testCache ()
 Cache tests 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$

needsInstalledILIAS

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 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: