function ViewsUpgradeTestCase::viewUpgradeImport

1 call to ViewsUpgradeTestCase::viewUpgradeImport()
ViewsUpgradeTestCase::testUpgradeImport in tests/views_upgrade.test
Tests a import via ui.

File

tests/views_upgrade.test, line 208

Class

ViewsUpgradeTestCase
Try to test the upgrade path of all conversions.

Code

protected function viewUpgradeImport() {
    $import = '
      $view = new view;
      $view->name = "comments_recent";
      $view->description = "Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.";
      $view->tag = "default";
      $view->base_table = "comments";
      $view->human_name = "";
      $view->core = 0;
      $view->api_version = "3.0-alpha1";
      $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

      /* Display: Defaults */
      $handler = $view->new_display("default", "Defaults", "default");
      $handler->display->display_options["title"] = "Recent comments";
      $handler->display->display_options["use_more"] = TRUE;
      $handler->display->display_options["access"]["type"] = "none";
      $handler->display->display_options["cache"]["type"] = "none";
      $handler->display->display_options["query"]["type"] = "views_query";
      $handler->display->display_options["exposed_form"]["type"] = "basic";
      $handler->display->display_options["pager"]["type"] = "some";
      $handler->display->display_options["pager"]["options"]["items_per_page"] = 5;
      $handler->display->display_options["style_plugin"] = "list";
      $handler->display->display_options["row_plugin"] = "fields";
      /* Relationship: Comment: Node */
      $handler->display->display_options["relationships"]["nid"]["id"] = "nid";
      $handler->display->display_options["relationships"]["nid"]["table"] = "comments";
      $handler->display->display_options["relationships"]["nid"]["field"] = "nid";
      /* Field: Comment: Title */
      $handler->display->display_options["fields"]["subject"]["id"] = "subject";
      $handler->display->display_options["fields"]["subject"]["table"] = "comments";
      $handler->display->display_options["fields"]["subject"]["field"] = "subject";
      $handler->display->display_options["fields"]["subject"]["label"] = "";
      $handler->display->display_options["fields"]["subject"]["link_to_comment"] = 1;
      /* Field: Comment: Post date */
      $handler->display->display_options["fields"]["timestamp"]["id"] = "timestamp";
      $handler->display->display_options["fields"]["timestamp"]["table"] = "comments";
      $handler->display->display_options["fields"]["timestamp"]["field"] = "timestamp";
      $handler->display->display_options["fields"]["timestamp"]["label"] = "";
      $handler->display->display_options["fields"]["timestamp"]["date_format"] = "time ago";
      /* Sort criterion: Comment: Post date */
      $handler->display->display_options["sorts"]["timestamp"]["id"] = "timestamp";
      $handler->display->display_options["sorts"]["timestamp"]["table"] = "comments";
      $handler->display->display_options["sorts"]["timestamp"]["field"] = "timestamp";
      $handler->display->display_options["sorts"]["timestamp"]["order"] = "DESC";
      /* Filter: Node: Published or admin */
      $handler->display->display_options["filters"]["status_extra"]["id"] = "status_extra";
      $handler->display->display_options["filters"]["status_extra"]["table"] = "node";
      $handler->display->display_options["filters"]["status_extra"]["field"] = "status_extra";
      $handler->display->display_options["filters"]["status_extra"]["relationship"] = "nid";
      $handler->display->display_options["filters"]["status_extra"]["group"] = 0;
      $handler->display->display_options["filters"]["status_extra"]["expose"]["operator"] = FALSE;

      /* Display: Page */
      $handler = $view->new_display("page", "Page", "page");
      $handler->display->display_options["defaults"]["items_per_page"] = FALSE;
      $handler->display->display_options["defaults"]["style_plugin"] = FALSE;
      $handler->display->display_options["style_plugin"] = "list";
      $handler->display->display_options["defaults"]["style_options"] = FALSE;
      $handler->display->display_options["defaults"]["row_plugin"] = FALSE;
      $handler->display->display_options["row_plugin"] = "fields";
      $handler->display->display_options["row_options"]["inline"] = array(
        "title" => "title",
        "timestamp" => "timestamp",
      );
      $handler->display->display_options["row_options"]["separator"] = " ";
      $handler->display->display_options["defaults"]["row_options"] = FALSE;
      $handler->display->display_options["defaults"]["fields"] = FALSE;
      /* Field: Node: Title */
      $handler->display->display_options["fields"]["title"]["id"] = "title";
      $handler->display->display_options["fields"]["title"]["table"] = "node";
      $handler->display->display_options["fields"]["title"]["field"] = "title";
      $handler->display->display_options["fields"]["title"]["relationship"] = "nid";
      $handler->display->display_options["fields"]["title"]["label"] = "Reply to";
      $handler->display->display_options["fields"]["title"]["link_to_node"] = 1;
      /* Field: Comment: Post date */
      $handler->display->display_options["fields"]["timestamp"]["id"] = "timestamp";
      $handler->display->display_options["fields"]["timestamp"]["table"] = "comments";
      $handler->display->display_options["fields"]["timestamp"]["field"] = "timestamp";
      $handler->display->display_options["fields"]["timestamp"]["label"] = "";
      $handler->display->display_options["fields"]["timestamp"]["date_format"] = "time ago";
      /* Field: Comment: Title */
      $handler->display->display_options["fields"]["subject"]["id"] = "subject";
      $handler->display->display_options["fields"]["subject"]["table"] = "comments";
      $handler->display->display_options["fields"]["subject"]["field"] = "subject";
      $handler->display->display_options["fields"]["subject"]["label"] = "";
      $handler->display->display_options["fields"]["subject"]["link_to_comment"] = 1;
      /* Field: Comment: Body */
      $handler->display->display_options["fields"]["comment"]["id"] = "comment";
      $handler->display->display_options["fields"]["comment"]["table"] = "comments";
      $handler->display->display_options["fields"]["comment"]["field"] = "comment";
      $handler->display->display_options["fields"]["comment"]["label"] = "";
      $handler->display->display_options["path"] = "comments/recent";

      /* Display: Block */
      $handler = $view->new_display("block", "Block", "block");
      $handler->display->display_options["block_description"] = "Recent comments view"
;';
    return $import;
}