NewViewConfigSchemaTest.php 1.18 KB
Newer Older
1 2
<?php

3
namespace Drupal\Tests\views_ui\Functional;
4 5 6 7 8 9

/**
 * Tests configuration schema against new views.
 *
 * @group views_ui
 */
10
class NewViewConfigSchemaTest extends UITestBase {
11 12 13 14 15 16

  /**
   * Modules to enable.
   *
   * @var array
   */
17
  public static $modules = ['views_ui', 'node', 'comment', 'file', 'taxonomy', 'dblog', 'aggregator'];
18 19 20 21 22

  /**
   * Tests creating brand new views.
   */
  public function testNewViews() {
23
    $this->drupalLogin($this->drupalCreateUser(['administer views']));
24 25

    // Create views with all core Views wizards.
26
    $wizards = [
27 28 29 30 31 32 33 34 35 36 37
      // Wizard with their own classes.
      'node',
      'node_revision',
      'users',
      'comment',
      'file_managed',
      'taxonomy_term',
      'watchdog',
      // Standard derivative classes.
      'standard:aggregator_feed',
      'standard:aggregator_item',
38
    ];
39
    foreach ($wizards as $wizard_key) {
40
      $edit = [];
41 42 43 44 45 46 47 48 49
      $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'));
    }
  }

}