Skip to content

Instantly share code, notes, and snippets.

@damiankloip
Created November 15, 2012 13:32
Show Gist options
  • Save damiankloip/4078681 to your computer and use it in GitHub Desktop.
Save damiankloip/4078681 to your computer and use it in GitHub Desktop.
diff --git a/core/modules/views/lib/Drupal/views/Tests/UI/PreviewTest.php b/core/modules/views/lib/Drupal/views/Tests/UI/PreviewTest.php
new file mode 100644
index 0000000..ee47782
--- /dev/null
+++ b/core/modules/views/lib/Drupal/views/Tests/UI/PreviewTest.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\views\Tests\UI\PreviewTest.
+ */
+
+namespace Drupal\views\Tests\UI;
+
+/**
+ * Tests the various settings in the views UI.
+ */
+class PreviewTest extends UITestBase {
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Preview functionality',
+ 'description' => 'Tests the UI preview functionality.',
+ 'group' => 'Views UI',
+ );
+ }
+
+ /**
+ * Tests the settings for the edit ui.
+ */
+ function testPreviewUI() {
+ $this->drupalLogin($this->adminUser);
+
+ $this->drupalGet('admin/structure/views/view/test_preview/edit');
+ $this->assertResponse(200);
+ }
+
+}
diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_preview.yml b/core/modules/views/tests/views_test_config/config/views.view.test_preview.yml
new file mode 100644
index 0000000..a9d9346
--- /dev/null
+++ b/core/modules/views/tests/views_test_config/config/views.view.test_preview.yml
@@ -0,0 +1,61 @@
+api_version: '3.0'
+base_field: nid
+base_table: views_test_data
+core: 8.x
+description: ''
+disabled: '0'
+display:
+ default:
+ display_plugin: default
+ id: default
+ display_title: Master
+ position: ''
+ display_options:
+ access:
+ type: perm
+ cache:
+ type: none
+ query:
+ type: views_query
+ exposed_form:
+ type: basic
+ pager:
+ type: some
+ options:
+ items_per_page: '10'
+ offset: '0'
+ style:
+ type: default
+ row:
+ type: fields
+ fields:
+ name:
+ id: standard
+ table: views_test_data
+ field: name
+ relationship: none
+ group_type: group
+ admin_label: ''
+ label: Name
+ exclude: '0'
+ filters: { }
+ sorts: { }
+ filter_groups:
+ operator: AND
+ groups: { }
+ title: 'Test preview'
+ arguments:
+ id:
+ id: numeric
+ table: views_test_data
+ field: id
+ relationship: none
+ group_type: group
+ admin_label: ''
+ default_action: ignore
+ title_enable: '0'
+ title: ''
+human_name: test_preview
+module: views
+name: test_preview
+tag: ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment