You are here

function AkamaiHookTestCase::testHookClear in Akamai 7.2

Same name and namespace in other branches
  1. 8 akamai.test \AkamaiHookTestCase::testHookClear()
  2. 8.2 akamai.test \AkamaiHookTestCase::testHookClear()
  3. 7.3 akamai.test \AkamaiHookTestCase::testHookClear()
  4. 7 akamai.test \AkamaiHookTestCase::testHookClear()

Tests clear with hook provided paths.

File

./akamai.test, line 191
Akamai tests.

Class

AkamaiHookTestCase
Test basic API.

Code

function testHookClear() {
  $node = $this
    ->drupalCreateNode(array(
    'type' => 'page',
    'promote' => 1,
  ));
  $canonical = "node/{$node->nid}";
  $response = akamai_clear_url($canonical, array(), $node);
  $paths = !empty($response->client->paths) ? $response->client->paths : array();
  $this
    ->assertEqual(2, count($paths), "Two paths cleared");
  $this
    ->assertEqual($canonical, $paths[0], "Correct canonical path was cleared");
  $this
    ->assertEqual("akamai/paths/alter/test", $paths[1], "Correct hook provided path was cleared");
}