Beispiel #1
0
 public function setValue($key, $value, array $tags = array(), $lifeTime = NULL)
 {
     if (is_null($lifeTime) || (int) $lifeTime <= 0) {
         $lifeTime = 60 * 60 * 24 * 365 * 5;
     }
     $cacheKey = \Ess\M2ePro\Helper\Data::CUSTOM_IDENTIFIER . '_' . $key;
     $preparedTags = array(\Ess\M2ePro\Helper\Data::CUSTOM_IDENTIFIER . '_main');
     foreach ($tags as $tag) {
         $preparedTags[] = \Ess\M2ePro\Helper\Data::CUSTOM_IDENTIFIER . '_' . $tag;
     }
     $this->cache->save(@serialize($value), $cacheKey, $preparedTags, (int) $lifeTime);
 }
Beispiel #2
0
 /**
  * @dataProvider saveDataProvider
  * @param string|mixed $inputData
  * @param string $inputId
  * @param array $inputTags
  * @param string $expectedData
  * @param string $expectedId
  * @param array $expectedTags
  */
 public function testSave($inputData, $inputId, $inputTags, $expectedData, $expectedId, $expectedTags)
 {
     $this->_cacheFrontendMock->expects($this->once())->method('save')->with($this->identicalTo($expectedData), $expectedId, $expectedTags);
     $this->_model->save($inputData, $inputId, $inputTags);
 }