/** * @test */ public function Invalidate_ReturnTrue() { $this->emptyCacheProvider->save(CacheProviderMock::NAMESPACE_ID, CacheProviderMock::NAMESPACE_ID_VALUE); $this->emptyCacheProvider->save(CacheProviderMock::NAMESPACE_ID_VALUE . CacheProviderMock::ID, CacheProviderMock::NAMESPACE_DATA); $invalidated = $this->emptyCacheProviderDecorator->invalidate(CacheProviderMock::NAMESPACE_ID); $this->assertTrue($invalidated); $this->assertTrue($this->emptyCacheProvider->doSaveHasBeenCalled); }
/** * {@inheritdoc} */ public function saveWithNamespace($id, $data, $namespaceId = null, $lifeTime = null) { $start = $this->startQuery(); $saved = $this->cacheProviderDecorator->saveWithNamespace($id, $data, $namespaceId, $lifeTime); $stop = $this->stopQuery(); self::$collectedData[self::$callId++] = $this->create(CacheCollectedData::SAVE_WITH_NAMESPACE)->withData($data)->withId($id)->withNamespaceId($namespaceId)->withStart($start)->withStop($stop)->build(); return $saved; }
/** * @inheritDoc */ protected function doGetStats() { return $this->cacheProviderDecorator->doGetStats(); }