class AkamaiHookTestCase in Akamai 8
Same name and namespace in other branches
- 8.2 akamai.test \AkamaiHookTestCase
- 7.3 akamai.test \AkamaiHookTestCase
- 7 akamai.test \AkamaiHookTestCase
- 7.2 akamai.test \AkamaiHookTestCase
Test basic API.
Hierarchy
- class \AkamaiHookTestCase extends \DrupalWebTestCase
Expanded class hierarchy of AkamaiHookTestCase
File
- ./akamai.test, line 171 
- Akamai tests.
View source
class AkamaiHookTestCase extends DrupalWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'Akamai Hook Test',
      'description' => 'Test the implementation of the hooks defined by the Akamai module',
      'group' => 'Akamai',
    );
  }
  function setUp() {
    parent::setUp('akamai', 'akamai_test');
    $user = $this
      ->drupalCreateUser(array(
      'purge akamai cache',
    ));
    $this
      ->drupalLogin($user);
    variable_set('akamai_service_class', 'RecordingCacheControlClient');
  }
  /**
   * Tests clear with hook provided paths.
   */
  function testHookClear() {
    $node = $this
      ->drupalCreateNode(array(
      'type' => 'page',
      'promote' => 1,
    ));
    $canonical = "node/{$node->nid}";
    $response = akamai_clear_url($canonical, array(), $node);
    $paths = $response['client']->paths;
    $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");
  }
  /**
   * Tests clear with no paths.
   */
  function testEmptyClear() {
    $response = akamai_clear_url('clear/me');
    $this
      ->assertFalse($response, "False returned");
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| AkamaiHookTestCase:: | public static | function | ||
| AkamaiHookTestCase:: | function | |||
| AkamaiHookTestCase:: | function | Tests clear with no paths. | ||
| AkamaiHookTestCase:: | function | Tests clear with hook provided paths. | 
