You are here

function PanelizerTestHelper::addTestPane in Panelizer 7.3

Add a custom text pane to a display.

1 call to PanelizerTestHelper::addTestPane()
PanelizerNodeContentTranslationTest::testContentTranslation in tests/panelizer.node_content_translation.test
Verify that when a node is translated the customized Panelizer display is cloned to the new node.

File

tests/panelizer.helper.test, line 101
Test integration for the panelizer module.

Class

PanelizerTestHelper
This will be extended by other tests to simplify them and make the code more reusable.

Code

function addTestPane(&$display, $text = 'Hello world') {
  $custom = ctools_get_content_type('custom');

  // Create a basic 'custom' pane.
  $pane = panels_new_pane('custom', 'custom');
  $pane->configuration = ctools_content_get_defaults($custom, 'custom');
  $pane->configuration['title'] = 'test';
  $pane->configuration['body'] = $text;

  // Add the pane to the display.
  $display
    ->add_pane($pane, 'center');
}