You are here

protected function AuthcacheTestBackend::assertNoVary in Authenticated User Page Caching (Authcache) 7.2

Assert that a certain vary-field is not in the Vary header.

File

tests/authcache.backend.test, line 69
Test cases for pluggable cache backends.

Class

AuthcacheTestBackend
Cover authcache module.

Code

protected function assertNoVary($rejectvary, $message = NULL) {
  $varyheader = $this
    ->drupalGetHeader('Vary') ?: '';
  $varyfields = array_map('trim', explode(',', $varyheader));
  $this
    ->assert(!in_array($rejectvary, $varyfields), $message ?: t('Vary header @header does not contain field @field.', array(
    '@field' => $rejectvary,
    '@header' => $varyheader,
  )));
}