You are here

ViewsFormTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/views/src/Tests/Plugin/ViewsFormTest.php

File

core/modules/views/src/Tests/Plugin/ViewsFormTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\views\Tests\Plugin\ViewsFormTest.
 */
namespace Drupal\views\Tests\Plugin;

use Drupal\simpletest\WebTestBase;

/**
 * Tests Views forms functionality.
 *
 * @group views
 */
class ViewsFormTest extends WebTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array(
    'action_bulk_test',
  );

  /**
   * Tests the Views form wrapper.
   */
  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.');
  }

}

Classes

Namesort descending Description
ViewsFormTest Tests Views forms functionality.