コード例 #1
0
 /**
  * @test
  */
 public function SaveWithNamespace()
 {
     $this->assertTrue($this->emptyCacheProviderDecorator->saveWithNamespace(CacheProviderMock::ID, CacheProviderMock::DATA, CacheProviderMock::NAMESPACE_ID, self::LIFE_TIME));
     $this->assertTrue($this->emptyCacheProvider->doSaveHasBeenCalled);
     $this->assertStringStartsWith(self::EXPECTED_NAMESPACE_ID_VALUE, $this->emptyCacheProvider->id);
     $this->assertEquals(CacheProviderMock::DATA, $this->emptyCacheProvider->data);
     $this->assertEquals(self::LIFE_TIME, $this->emptyCacheProvider->lifeTime);
 }
 /**
  * {@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
  */
 public function saveWithNamespace($id, $data, $namespaceId = null, $lifeTime = null)
 {
     return $this->cacheProviderDecorator->saveWithNamespace($id, $data, $namespaceId, $lifeTime);
 }