You are here

function AkamaiHomepageTestCase::testHomepageClear in Akamai 7.2

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

Tests clear of homepage and rendering of block

File

./akamai.test, line 145
Akamai tests.

Class

AkamaiHomepageTestCase
Test basic API.

Code

function testHomepageClear() {
  $block = block_load('akamai', 'akamai');
  db_update('block')
    ->fields(array(
    'region' => 'footer',
    'status' => 1,
  ))
    ->condition('module', $block->module)
    ->condition('delta', $block->delta)
    ->condition('theme', $block->theme)
    ->execute();
  $this
    ->drupalGet($this->homepage);
  $this
    ->assertFieldByName('path', $this->homepage, 'The Akamai path field is set correctly');
  $this
    ->assertUniqueText(t('[frontpage]'), t('Make sure the text "[frontpage]" appears exactly once on the home page.'));
  $response = akamai_clear_url($this->homepage, array(), $this->node);
  $paths = !empty($response->client->paths) ? $response->client->paths : array();
  $this
    ->assertEqual(2, count($paths), "Two paths cleared");
  $this
    ->assertEqual($this->homepage, $paths[0], "Correct homepage real path was cleared");
  $this
    ->assertEqual('', $paths[1], "Correct homepage path was cleared");
}