@@ -23,9 +23,9 @@ |
||
| 23 | 23 | $keys = []; |
| 24 | 24 | |
| 25 | 25 | $dirs = [ |
| 26 | - __DIR__ . '/../var/cache/IO-', |
|
| 27 | - sys_get_temp_dir() . '/phpfastcache/IO-1', |
|
| 28 | - sys_get_temp_dir() . '/phpfastcache/IO-2' |
|
| 26 | + __DIR__ . '/../var/cache/IO-', |
|
| 27 | + sys_get_temp_dir() . '/phpfastcache/IO-1', |
|
| 28 | + sys_get_temp_dir() . '/phpfastcache/IO-2' |
|
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $cacheInstanceName = 'cacheInstance' . $i; |
| 41 | 41 | |
| 42 | - $instances[$dirIndex][$cacheInstanceName] = CacheManager::getInstance('Files',array('path' => $dir . str_pad($i, 3, '0', STR_PAD_LEFT))); |
|
| 42 | + $instances[$dirIndex][$cacheInstanceName] = CacheManager::getInstance('Files', array('path' => $dir . str_pad($i, 3, '0', STR_PAD_LEFT))); |
|
| 43 | 43 | |
| 44 | - foreach($keys[$dirIndex] as $index => $key) |
|
| 44 | + foreach ($keys[$dirIndex] as $index => $key) |
|
| 45 | 45 | { |
| 46 | 46 | $items[$dirIndex][$index] = $instances[$dirIndex][$cacheInstanceName]->getItem($key); |
| 47 | 47 | $items[$dirIndex][$index]->set("test-$dirIndex-$index")->expiresAfter(600); |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | $instances[$dirIndex][$cacheInstanceName]->detachAllItems(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - foreach($instances[$dirIndex] as $cacheInstanceName => $instance) |
|
| 54 | + foreach ($instances[$dirIndex] as $cacheInstanceName => $instance) |
|
| 55 | 55 | { |
| 56 | - foreach($keys[$dirIndex] as $index => $key) |
|
| 56 | + foreach ($keys[$dirIndex] as $index => $key) |
|
| 57 | 57 | { |
| 58 | - if($instances[$dirIndex][$cacheInstanceName]->getItem($key)->get() === "test-$dirIndex-$index") |
|
| 58 | + if ($instances[$dirIndex][$cacheInstanceName]->getItem($key)->get() === "test-$dirIndex-$index") |
|
| 59 | 59 | { |
| 60 | 60 | echo "[PASS] Item #{$key} of instance #{$cacheInstanceName} of dir #{$dirIndex} has returned the expected value (" . gettype("test-$dirIndex-$index") . ":'" . "test-$dirIndex-$index" . "')\n"; |
| 61 | 61 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if($instances[$dirIndex][$cacheInstanceName]->getItem($key)->get() === "test-$dirIndex-$index") |
| 59 | 59 | { |
| 60 | 60 | echo "[PASS] Item #{$key} of instance #{$cacheInstanceName} of dir #{$dirIndex} has returned the expected value (" . gettype("test-$dirIndex-$index") . ":'" . "test-$dirIndex-$index" . "')\n"; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | echo "[FAIL] Item #{$key} of instance #{$cacheInstanceName} of dir #{$dirIndex} returned an unexpected value (" . gettype($instances[$dirIndex][$cacheInstanceName]->getItem($key)->get()) . ":'" . $instances[$dirIndex][$cacheInstanceName]->getItem($key)->get() . "') expected (" . gettype("test-$dirIndex-$index") . ":'" . "test-$dirIndex-$index" . "') \n"; |
| 65 | 64 | $status = 255; |