function AkamaiTestCase::testMultipleAliasClear in Akamai 8.2
Same name and namespace in other branches
- 8 akamai.test \AkamaiTestCase::testMultipleAliasClear()
- 7.3 akamai.test \AkamaiTestCase::testMultipleAliasClear()
- 7 akamai.test \AkamaiTestCase::testMultipleAliasClear()
- 7.2 akamai.test \AkamaiTestCase::testMultipleAliasClear()
Tests clear with multiple aliases.
File
- ./
akamai.test, line 81 - Akamai tests.
Class
- AkamaiTestCase
- Test basic API.
Code
function testMultipleAliasClear() {
$node = $this
->drupalCreateNode(array(
'type' => 'page',
'promote' => 1,
));
$canonical = "node/{$node->nid}";
$cleanurl1 = "content/pretty-title/{$node->nid}";
$cleanurl2 = "blog/better-title/{$node->nid}";
$cleanurl3 = "article/another-title/{$node->nid}";
$alias = array(
'source' => $canonical,
'alias' => $cleanurl1,
);
path_save($alias);
$alias = array(
'source' => $canonical,
'alias' => $cleanurl2,
);
path_save($alias);
$alias = array(
'source' => $canonical,
'alias' => $cleanurl3,
);
path_save($alias);
$response = akamai_clear_url($canonical, array(), $node);
$paths = $response['client']->paths;
$this
->assertEqual(4, count($paths), "Four paths cleared");
$this
->assertEqual($canonical, $paths[0], "Correct canonical path was cleared");
$this
->assertEqual($cleanurl1, $paths[1], "Correct alias 1 path was cleared");
$this
->assertEqual($cleanurl2, $paths[2], "Correct alias 2 path was cleared");
$this
->assertEqual($cleanurl3, $paths[3], "Correct alias 3 path was cleared");
}