You are here

protected function TestPageManagerConfiguration::createConfigToExport in Configuration Management 7.2

This function creates the configurations that will be exported by configuration management.

Overrides ConfigurationHandlerBaseTestCase::createConfigToExport

File

tests/handlers/TestPageManagerConfiguration.test, line 128
Tests for Configuration Management: Page manager components and dependencies.

Class

TestPageManagerConfiguration
@file Tests for Configuration Management: Page manager components and dependencies.

Code

protected function createConfigToExport() {

  // Create a page object.
  $page = new stdClass();
  $page->disabled = FALSE;

  /* Edit this to true to make a default page disabled initially */
  $page->api_version = 1;
  $page->name = 'configuration_test_page';
  $page->task = 'page';
  $page->admin_title = 'Configuration Test Page';
  $page->admin_description = 'Configuration Test Page Description.';
  $page->path = 'config-test-page';
  $page->access = array(
    'logic' => 'and',
  );
  $page->menu = array(
    'type' => 'none',
    'title' => '',
    'name' => 'navigation',
    'weight' => '0',
    'parent' => array(
      'type' => 'none',
      'title' => '',
      'name' => 'navigation',
      'weight' => '0',
    ),
  );
  $page->arguments = array();
  $page->conf = array(
    'admin_paths' => FALSE,
  );
  $page->export_type = NULL;
  $result = ctools_export_crud_save('page_manager_pages', $page);

  // Create a page handler object.
  $handler = new stdClass();
  $handler->disabled = FALSE;

  /* Edit this to true to make a default handler disabled initially */
  $handler->api_version = 1;
  $handler->name = 'page_configuration_test_page_panel_context';
  $handler->task = 'page';
  $handler->subtask = 'configuration_test_page';
  $handler->handler = 'panel_context';
  $handler->weight = 0;
  $handler->conf = array(
    'title' => 'Panel',
    'no_blocks' => 0,
    'pipeline' => 'standard',
    'body_classes_to_remove' => '',
    'body_classes_to_add' => '',
    'css_id' => '',
    'css' => '',
    'contexts' => array(),
    'relationships' => array(),
    'access' => array(
      'logic' => 'and',
    ),
  );
  $display = new panels_display();
  $display->layout = 'threecol_33_34_33';
  $display->layout_settings = array();
  $display->panel_settings = array(
    'style_settings' => array(
      'default' => NULL,
      'left' => NULL,
      'middle' => NULL,
      'right' => NULL,
    ),
  );
  $display->cache = array();
  $display->title = '';
  $display->content = array();
  $display->panels = array();
  $pane = new stdClass();
  $pane->pid = 'new-3';
  $pane->panel = 'middle';
  $pane->type = 'views';
  $pane->subtype = 'test';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'override_pager_settings' => 0,
    'use_pager' => 1,
    'nodes_per_page' => '10',
    'pager_id' => '0',
    'offset' => '0',
    'more_link' => 0,
    'feed_icons' => 0,
    'panel_args' => 0,
    'link_to_view' => 0,
    'args' => '',
    'url' => '',
    'display' => 'default',
    'override_title' => 0,
    'override_title_text' => '',
  );
  $pane->cache = array();
  $pane->style = array(
    'settings' => NULL,
  );
  $pane->css = array();
  $pane->extras = array();
  $pane->position = 0;
  $pane->locks = array();
  $display->content['new-3'] = $pane;
  $display->panels['middle'][0] = 'new-3';
  $display->hide_title = PANELS_TITLE_FIXED;
  $display->title_pane = '0';
  $handler->conf['display'] = $display;
  $handler->export_type = NULL;
  $result = ctools_export_crud_save('page_manager_handlers', $handler);
  $web_user = $this
    ->drupalCreateUser(array(
    'administer views',
    'access content',
  ));
  $this
    ->drupalLogin($web_user);
  $edit = array();
  $edit['human_name'] = 'Test';
  $edit['name'] = 'test';
  $edit['page[title]'] = 'My custom view';
  $edit['page[path]'] = 'custom_view';
  $this
    ->drupalPost('admin/structure/views/add', $edit, t('Save & exit'));
  $this
    ->assertRaw('My custom view', "The view was saved in the ActiveStore.");
}