Backup of db before drupal security update
[yaffs-website] / web / core / modules / views_ui / src / Tests / NewViewConfigSchemaTest.php
1 <?php
2
3 namespace Drupal\views_ui\Tests;
4
5 use Drupal\simpletest\WebTestBase;
6
7 /**
8  * Tests configuration schema against new views.
9  *
10  * @group views_ui
11  */
12 class NewViewConfigSchemaTest extends WebTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['views_ui', 'node', 'comment', 'file', 'taxonomy', 'dblog', 'aggregator'];
20
21   /**
22    * Tests creating brand new views.
23    */
24   public function testNewViews() {
25     $this->drupalLogin($this->drupalCreateUser(['administer views']));
26
27     // Create views with all core Views wizards.
28     $wizards = [
29       // Wizard with their own classes.
30       'node',
31       'node_revision',
32       'users',
33       'comment',
34       'file_managed',
35       'taxonomy_term',
36       'watchdog',
37       // Standard derivative classes.
38       'standard:aggregator_feed',
39       'standard:aggregator_item',
40     ];
41     foreach ($wizards as $wizard_key) {
42       $edit = [];
43       $edit['label'] = $this->randomString();
44       $edit['id'] = strtolower($this->randomMachineName());
45       $edit['show[wizard_key]'] = $wizard_key;
46       $edit['description'] = $this->randomString();
47       $this->drupalPostForm('admin/structure/views/add', $edit, t('Save and edit'));
48     }
49   }
50
51 }