You are here

public function ViewsFormTest::testFormWrapper in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Plugin/ViewsFormTest.php \Drupal\views\Tests\Plugin\ViewsFormTest::testFormWrapper()

Tests the Views form wrapper.

File

core/modules/views/src/Tests/Plugin/ViewsFormTest.php, line 29
Contains \Drupal\views\Tests\Plugin\ViewsFormTest.

Class

ViewsFormTest
Tests Views forms functionality.

Namespace

Drupal\views\Tests\Plugin

Code

public function testFormWrapper() {
  $this
    ->drupalGet('test_bulk_form');

  // Ensure we have the form tag on the page.
  $xpath = $this
    ->cssSelect('.views-form form');
  $this
    ->assertIdentical(count($xpath), 1, 'There is one views form on the page.');

  // Ensure we don't have nested form elements.
  $result = (bool) preg_match('#<form[^>]*?>(?!/form).*<form#s', $this
    ->getRawContent());
  $this
    ->assertFalse($result, 'The views form element is not nested.');
}