ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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$

@group needsInstalledILIAS

Definition at line 35 of file ilCacheTest.php.

Member Function Documentation

◆ setUp()

ilCacheTest::setUp ( )
protected

Definition at line 39 of file ilCacheTest.php.

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

◆ testCache()

ilCacheTest::testCache ( )

Cache tests @group IL_Init.

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 37 of file ilCacheTest.php.


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