You are here

protected function AuthcacheVarnishTestCase::assertNoCacheControl in Authenticated User Page Caching (Authcache) 7.2

Assert that a certain directive is not in the Cache-Control header.

3 calls to AuthcacheVarnishTestCase::assertNoCacheControl()
AuthcacheVarnishTestCase::testGetKeyMenuCallback in modules/authcache_varnish/authcache_varnish.test
Cover authcache_varnish_get_key menu callback.
AuthcacheVarnishTestCase::testRequestValidation in modules/authcache_varnish/authcache_varnish.test
Cover authcache_varnish_request_validate().
AuthcacheVarnishTestCase::testVaryHeader in modules/authcache_varnish/authcache_varnish.test
Test presence of X-Authcache-Key header on HTTP response.

File

modules/authcache_varnish/authcache_varnish.test, line 64
Test cases for authcache_varnish module.

Class

AuthcacheVarnishTestCase
Cover authcache_varnish module.

Code

protected function assertNoCacheControl($rejectcc, $message = NULL) {
  $ccheader = $this
    ->drupalGetHeader('Cache-Control') ?: '';
  $ccfields = array_map('trim', explode(',', $ccheader));
  $this
    ->assert(!in_array($rejectcc, $ccfields), $message ?: t('Found unexpected @field in Cache-Control: @header.', array(
    '@field' => $rejectcc,
    '@header' => $ccheader,
  )));
}