Backup of db before drupal security update
[yaffs-website] / web / core / modules / views_ui / src / Tests / StyleTableTest.php
1 <?php
2
3 namespace Drupal\views_ui\Tests;
4
5 use Drupal\views\Views;
6
7 /**
8  * Tests the UI of views when using the table style.
9  *
10  * @group views_ui
11  * @see \Drupal\views\Plugin\views\style\Table.
12  */
13 class StyleTableTest extends UITestBase {
14
15   /**
16    * Tests created a table style view.
17    */
18   public function testWizard() {
19     // Create a new view and check that the first field has a label.
20     $view = [];
21     $view['label'] = $this->randomMachineName(16);
22     $view['id'] = strtolower($this->randomMachineName(16));
23     $view['show[wizard_key]'] = 'node';
24     $view['page[create]'] = TRUE;
25     $view['page[style][style_plugin]'] = 'table';
26     $view['page[title]'] = $this->randomMachineName(16);
27     $view['page[path]'] = $view['id'];
28     $this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
29
30     $view = Views::getView($view['id']);
31     $view->initHandlers();
32     $this->assertEqual($view->field['title']->options['label'], 'Title', 'The field label for table styles is not empty.');
33   }
34
35 }