class ViewsFormAlterTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Functional/ViewsFormAlterTest.php \Drupal\Tests\views\Functional\ViewsFormAlterTest
- 10 core/modules/views/tests/src/Functional/ViewsFormAlterTest.php \Drupal\Tests\views\Functional\ViewsFormAlterTest
Tests hook_form_BASE_FORM_ID_alter for a ViewsForm.
@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\ViewsFormAlterTest 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 ViewsFormAlterTest
File
-
core/
modules/ views/ tests/ src/ Functional/ ViewsFormAlterTest.php, line 10
Namespace
Drupal\Tests\views\FunctionalView source
class ViewsFormAlterTest extends ViewTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'views_form_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests hook_form_BASE_FORM_ID_alter for a ViewsForm.
*/
public function testViewsFormAlter() {
$this->drupalLogin($this->createUser([
'access media overview',
]));
$this->drupalGet('admin/content/media');
$count = $this->container
->get('state')
->get('hook_form_BASE_FORM_ID_alter_count');
$this->assertEquals(1, $count, 'hook_form_BASE_FORM_ID_alter was invoked only once');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.