|
6 | 6 |
|
7 | 7 | $cache1->changeConfig(['cacheDirectory' => '/tmp/rwFileCacheStorage/']);
|
8 | 8 |
|
9 |
| -$cache1->set('first.test.stringContent', 'Mary had a little lamb.', strtotime('+ 1 day')); |
| 9 | +// Test basic string storage and retrieval |
| 10 | +$key = 'first.test.stringContent'; |
| 11 | +$cache1->set($key, 'Mary had a little lamb.', strtotime('+ 1 day')); |
| 12 | +$var = $cache1->get($key); |
| 13 | +var_dump($var); |
| 14 | + |
| 15 | +// Test empty array storage and retrieval |
| 16 | +$key = 'second.test.emptyArray'; |
| 17 | +$cache1->set($key, [], strtotime('+ 1 day')); |
| 18 | +$var = $cache1->get($key); |
| 19 | +var_dump($var); |
10 | 20 |
|
11 |
| -$var = $cache1->get('first.test.stringContent'); |
| 21 | +// Test numeric zero storage and retrieval |
| 22 | +$key = 'third.test.numericZero'; |
| 23 | +$cache1->set($key, 0, strtotime('+ 1 day')); |
| 24 | +$var = $cache1->get($key); |
| 25 | +var_dump($var); |
| 26 | + |
| 27 | +// Test boolean false storage and retrieval |
| 28 | +$key = 'fourth.test.booleanFalse'; |
| 29 | +$cache1->set($key, false, strtotime('+ 1 day')); |
| 30 | +$var = $cache1->get($key); |
| 31 | +var_dump($var); |
12 | 32 |
|
| 33 | +// Test boolean true storage and retrieval |
| 34 | +$key = 'fifth.test.booleanTrue'; |
| 35 | +$cache1->set($key, true, strtotime('+ 1 day')); |
| 36 | +$var = $cache1->get($key); |
13 | 37 | var_dump($var);
|
0 commit comments