You are here

public function AuthcacheP13nTestSession::testInvalidateOnPost in Authenticated User Page Caching (Authcache) 7.2

Ensure that browser session is invalidated on every post request.

File

modules/authcache_p13n/tests/authcache_p13n.session.test, line 54
Define test for browser cache invalidation.

Class

AuthcacheP13nTestSession
Tests browser cache invalidation.

Code

public function testInvalidateOnPost() {
  $stub = $this->stubmod
    ->hook('authcache_p13n_session_invalidate');

  // We need to post manually here, drupalPost would attempt to GET the form
  // before (and would fail).
  $action = url('<front>', array(
    'absolute' => TRUE,
  ));
  $this
    ->curlExec(array(
    CURLOPT_URL => $action,
    CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => '',
  ));

  // Ensure that any changes to variables in the other thread are picked up.
  $this
    ->refreshVariables();
  $this
    ->assertStub($stub, HookStub::once());
}