diff --git a/src/Bridges/CacheBridgeAbstract.php b/src/Bridges/CacheBridgeAbstract.php index 8f7e45b..e4c487d 100644 --- a/src/Bridges/CacheBridgeAbstract.php +++ b/src/Bridges/CacheBridgeAbstract.php @@ -118,7 +118,7 @@ final public function save(CacheItemInterface $item): bool return false; } - $value = serialize($item->get()); + $value = serialize($item->getRawValue()); $key = $item->getKey(); $expires = $item->getExpiration(); diff --git a/tests/Unit/Bridges/CacheBridgeTest.php b/tests/Unit/Bridges/CacheBridgeTest.php index 437de08..5820561 100644 --- a/tests/Unit/Bridges/CacheBridgeTest.php +++ b/tests/Unit/Bridges/CacheBridgeTest.php @@ -36,9 +36,7 @@ expect($cache) ->toBeInstanceOf(CacheItemBridge::class) ->isHit()->toBeTrue() - ->get()->toBeNull() - ->set(42) - ->get()->toBe(42); + ->get()->toEqual(42); $results = $pool->getItems(); @@ -46,12 +44,12 @@ ->toBeArray() ->toHaveCount(0); - $results = $pool->getItems(['testing' => uniqid()]); + $results = $pool->getItems(['testing']); expect($results['testing']) ->toBeInstanceOf(CacheItemBridge::class) ->isHit()->toBeTrue() - ->get()->not()->toBe(42); + ->get()->toEqual(42); $this->app[\Illuminate\Cache\CacheManager::class] ->getStore()