You are here

function SkinrPanelsTestCase::testPanelsDefault in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr_panels/tests/skinr_panels.test \SkinrPanelsTestCase::testPanelsDefault()

Tests panels plugin.

@todo The below test doesn't work due to CTools/Panels not passing along enough data to create unique element ids when panels are in code. Skinr currently doesn't support panels in code.

File

skinr_panels/tests/skinr_panels.test, line 66
Tests for the Skinr Panels module.

Class

SkinrPanelsTestCase
Tests UI functionality for Panels plugin.

Code

function testPanelsDefault() {

  // Test panels pages.
  // Go to panel page.
  $this
    ->drupalGet('skinr-panels-test-panel');

  // Make sure our contextual link appears on the page.
  $this
    ->assertLinkByHref('admin/structure/skinr/edit/panels/pane__295dc791-d2a3-4f67-82e4-77c0b5ad671f/configure', 0, "Contexual link to edit pane's skin configuration on panel page (stored in code) was found.");
  $this
    ->drupalGet('admin/structure/mini-panels');

  // Test mini panels.
  // Add the mini block to the sidebar.
  $default_theme = variable_get('theme_default', 'bartik');
  db_merge('block')
    ->key(array(
    'theme' => $default_theme,
    'module' => 'panels_mini',
    'delta' => 'skinr_panels_test_mini_panel',
  ))
    ->fields(array(
    'status' => 1,
    'region' => 'sidebar_first',
    'pages' => '',
  ))
    ->execute();

  // Go front page.
  $this
    ->drupalGet('');

  // Make sure our contextual link appears on the page.
  $this
    ->assertLinkByHref('admin/structure/skinr/edit/panels/pane__c9bf0f8f-e48a-42d7-9a38-7a6760791765/configure', 0, 'Contexual link to edit pane\'s skin configuration on mini panel (stored in code) was found.');

  // Make sure this panel's options are returned.
  $this
    ->drupalGet('admin/structure/skinr/add');
  $this
    ->assertOptionExists('element', 'pane__295dc791-d2a3-4f67-82e4-77c0b5ad671f', 'Panel pane was returned by panels_skinr_ui_element_options().');
}