You are here

protected function FeedsHTTPCacheTest::createHttpResponse in Feeds 7.2

Creates a dummy HTTP response.

Parameters

bool $with_data: (optional) If data should be included. Defaults to TRUE.

Return value

object The created response.

7 calls to FeedsHTTPCacheTest::createHttpResponse()
FeedsHTTPCacheTest::createCacheRecord in tests/FeedsHTTPCacheTest.test
Creates a cache record, bypassing the API.
FeedsHTTPCacheTest::createCacheRecordUsingApi in tests/FeedsHTTPCacheTest.test
Creates a cache record using the API.
FeedsHTTPCacheTest::testClearExpired in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testClearExpiredUsingCacheLifeTime in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::clear().
FeedsHTTPCacheTest::testSaveFile in tests/FeedsHTTPCacheTest.test
@covers FeedsHTTPCache::saveFile().

... See full list

File

tests/FeedsHTTPCacheTest.test, line 53

Class

FeedsHTTPCacheTest
@coversDefaultClass FeedsHTTPCache @group feeds

Code

protected function createHttpResponse($with_data = TRUE) {
  $response = new stdClass();
  $response->code = 200;
  $response->headers = array(
    'content-type' => 'text/plain; charset=utf-8',
    'x-host' => 'http://www.example.com',
  );
  if ($with_data) {
    $response->data = static::randomString(255);
  }
  return $response;
}