NewViewConfigSchemaTest.php in Drupal 9
File
core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
View source
<?php
namespace Drupal\Tests\views_ui\Functional;
class NewViewConfigSchemaTest extends UITestBase {
protected static $modules = [
'views_ui',
'node',
'comment',
'file',
'taxonomy',
'dblog',
'aggregator',
];
protected $defaultTheme = 'stark';
public function testNewViews() {
$this
->drupalLogin($this
->drupalCreateUser([
'administer views',
]));
$wizards = [
'node',
'node_revision',
'users',
'comment',
'file_managed',
'taxonomy_term',
'watchdog',
'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
->drupalGet('admin/structure/views/add');
$this
->submitForm($edit, 'Save and edit');
}
}
}