class ViewsFormTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php \Drupal\Tests\views\Functional\Plugin\ViewsFormTest
- 10 core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php \Drupal\Tests\views\Functional\Plugin\ViewsFormTest
- 8.9.x core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php \Drupal\Tests\views\Functional\Plugin\ViewsFormTest
Tests Views forms functionality.
@group views
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\views\Functional\Plugin\ViewsFormTest extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ViewsFormTest
File
-
core/
modules/ views/ tests/ src/ Functional/ Plugin/ ViewsFormTest.php, line 12
Namespace
Drupal\Tests\views\Functional\PluginView source
class ViewsFormTest extends ViewTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'action_bulk_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* 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->assertCount(1, $xpath, '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->getSession()
->getPage()
->getContent());
$this->assertFalse($result, 'The views form element is not nested.');
// Test the form isn't shown when the display doesn't use fields.
$this->drupalGet('display-without-fields');
// Ensure there's no form.
$xpath = $this->cssSelect('.views-form form');
$this->assertCount(0, $xpath);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.