You are here

protected function FeedsHTTPCacheTest::createCacheRecordUsingApi in Feeds 7.2

Creates a cache record using the API.

Parameters

string $cid: (optional) The cache item ID.

object $response: (optional) The response to save.

Return value

string The cache item ID.

7 calls to FeedsHTTPCacheTest::createCacheRecordUsingApi()
FeedsHTTPCacheTest::testClear in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testClearAll in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testClearExpired in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testClearExpiredUsingCacheLifeTime in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testClearMultiple in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().

... See full list

File

tests/FeedsHTTPCacheTest.test, line 110

Class

FeedsHTTPCacheTest
@coversDefaultClass FeedsHTTPCache @group feeds

Code

protected function createCacheRecordUsingApi($cid = NULL, $response = NULL) {
  if (empty($cid)) {
    $cid = static::randomName();
  }
  if (empty($response)) {
    $response = $this
      ->createHttpResponse();
  }
  $this->cache
    ->set($cid, $response);
  return $cid;
}