Version 1
[yaffs-website] / web / core / modules / views_ui / src / Tests / NewViewConfigSchemaTest.php
diff --git a/web/core/modules/views_ui/src/Tests/NewViewConfigSchemaTest.php b/web/core/modules/views_ui/src/Tests/NewViewConfigSchemaTest.php
new file mode 100644 (file)
index 0000000..3318f0b
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+
+namespace Drupal\views_ui\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests configuration schema against new views.
+ *
+ * @group views_ui
+ */
+class NewViewConfigSchemaTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['views_ui', 'node', 'comment', 'file', 'taxonomy', 'dblog', 'aggregator'];
+
+  /**
+   * Tests creating brand new views.
+   */
+  public function testNewViews() {
+    $this->drupalLogin($this->drupalCreateUser(['administer views']));
+
+    // Create views with all core Views wizards.
+    $wizards = [
+      // Wizard with their own classes.
+      'node',
+      'node_revision',
+      'users',
+      'comment',
+      'file_managed',
+      'taxonomy_term',
+      'watchdog',
+      // Standard derivative classes.
+      'standard:aggregator_feed',
+      'standard:aggregator_item',
+    ];
+    foreach ($wizards as $wizard_key) {
+      $edit = [];
+      $edit['label'] = $this->randomString();
+      $edit['id'] = strtolower($this->randomMachineName());
+      $edit['show[wizard_key]'] = $wizard_key;
+      $edit['description'] = $this->randomString();
+      $this->drupalPostForm('admin/structure/views/add', $edit, t('Save and edit'));
+    }
+  }
+
+}