Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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 = array('views_ui', 'node', 'comment', 'file', 'taxonomy', 'dblog', 'aggregator');
/**
* Tests creating brand new views.
*/
public function testNewViews() {
$this->drupalLogin($this->drupalCreateUser(array('administer views')));
// Create views with all core Views wizards.
$wizards = array(
// 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 = array();
$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'));
}
}
}