Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / views / tests / src / Functional / Plugin / ViewsFormTest.php
1 <?php
2
3 namespace Drupal\Tests\views\Functional\Plugin;
4
5 use Drupal\Tests\views\Functional\ViewTestBase;
6
7 /**
8  * Tests Views forms functionality.
9  *
10  * @group views
11  */
12 class ViewsFormTest extends ViewTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['action_bulk_test'];
20
21   /**
22    * Tests the Views form wrapper.
23    */
24   public function testFormWrapper() {
25     $this->drupalGet('test_bulk_form');
26     // Ensure we have the form tag on the page.
27     $xpath = $this->cssSelect('.views-form form');
28     $this->assertIdentical(count($xpath), 1, 'There is one views form on the page.');
29     // Ensure we don't have nested form elements.
30     $result = (bool) preg_match('#<form[^>]*?>(?!/form).*<form#s', $this->getSession()->getPage()->getContent());
31     $this->assertFalse($result, 'The views form element is not nested.');
32   }
33
34 }