ViewsFormTest.php in Drupal 9
File
core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php
View source
<?php
namespace Drupal\Tests\views\Functional\Plugin;
use Drupal\Tests\views\Functional\ViewTestBase;
class ViewsFormTest extends ViewTestBase {
protected static $modules = [
'action_bulk_test',
];
protected $defaultTheme = 'stark';
public function testFormWrapper() {
$this
->drupalGet('test_bulk_form');
$xpath = $this
->cssSelect('.views-form form');
$this
->assertCount(1, $xpath, 'There is one views form on the page.');
$result = (bool) preg_match('#<form[^>]*?>(?!/form).*<form#s', $this
->getSession()
->getPage()
->getContent());
$this
->assertFalse($result, 'The views form element is not nested.');
}
}