|
@@ -16,8 +16,8 @@ discard block |
|
|
block discarded – undo |
|
16
|
16
|
$status = 0; |
|
17
|
17
|
echo "Testing EventManager\n"; |
|
18
|
18
|
|
|
19
|
|
-EventManager::getInstance()->onCacheSaveItem(function(ExtendedCacheItemPoolInterface $itemPool, ExtendedCacheItemInterface $item){ |
|
20
|
|
- if($item->get() === 1000){ |
|
|
19
|
+EventManager::getInstance()->onCacheSaveItem(function(ExtendedCacheItemPoolInterface $itemPool, ExtendedCacheItemInterface $item) { |
|
|
20
|
+ if ($item->get() === 1000) { |
|
21
|
21
|
$item->increment(337); |
|
22
|
22
|
} |
|
23
|
23
|
}); |
|
@@ -30,9 +30,9 @@ discard block |
|
|
block discarded – undo |
|
30
|
30
|
$cacheInstance->save($item); |
|
31
|
31
|
|
|
32
|
32
|
|
|
33
|
|
-if($cacheInstance->getItem($cacheKey)->get() === 1337){ |
|
|
33
|
+if ($cacheInstance->getItem($cacheKey)->get() === 1337) { |
|
34
|
34
|
echo "[PASS] The dispatched event executed the custom callback to alter to item.\n"; |
|
35
|
|
-}else{ |
|
|
35
|
+} else { |
|
36
|
36
|
echo "[FAIL] The dispatched event did not worked well, the expected value '1337', got '" . (int) $cacheInstance->getItem($cacheKey)->get() . "'\n"; |
|
37
|
37
|
$status = 1; |
|
38
|
38
|
} |
Please login to merge, or discard this patch.