function CacheActionsPanelsTestCase::testClearPanelPanes in Cache Actions 6.2
Same name and namespace in other branches
- 7.2 cache_actions.test \CacheActionsPanelsTestCase::testClearPanelPanes()
- 7 cache_actions.test \CacheActionsPanelsTestCase::testClearPanelPanes()
Test clearing panel page panes.
File
- ./
cache_actions.test, line 163 - This file contains the tests for Cache Actions. All tests depend on the panels, views and rules that are defined by the cache actions test module.
Class
- CacheActionsPanelsTestCase
- Tests for clearing panels.
Code
function testClearPanelPanes() {
// Needed in order to register the default panels.
drupal_flush_all_caches();
// Create a node.
$node = $this
->drupalCreateNode();
// Let's go to a panel, in order to make it cached.
$html = $this
->drupalGet('cache-actions-test-panel-pane');
// We should be able to see the title
$this
->assertText($node->title);
// Get a panel that doesn't have a rule that will be triggered.
$html = $this
->drupalGet('cache-actions-test-panel-pane-no-cache');
// We should be able to see the title
$this
->assertText($node->title);
// Alter the title.
$node->title = "Altered title";
node_save($node);
// The title should be correct in the first panel.
$html = $this
->drupalGet('cache-actions-test-panel-pane');
// We should be able to see the title
$this
->assertText($node->title);
// And not be correct in the second.
$html = $this
->drupalGet('cache-actions-test-panel-pane-no-cache');
$this
->assertNoText($node->title);
}