class BlockContentContextualLinksTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php \Drupal\Tests\block_content\Functional\BlockContentContextualLinksTest
- 9 core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php \Drupal\Tests\block_content\Functional\BlockContentContextualLinksTest
Tests views contextual links on block content.
@group block_content
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\block_content\Functional\BlockContentTestBase
- class \Drupal\Tests\block_content\Functional\BlockContentContextualLinksTest
- class \Drupal\Tests\block_content\Functional\BlockContentTestBase
Expanded class hierarchy of BlockContentContextualLinksTest
File
- core/
modules/ block_content/ tests/ src/ Functional/ BlockContentContextualLinksTest.php, line 10
Namespace
Drupal\Tests\block_content\FunctionalView source
class BlockContentContextualLinksTest extends BlockContentTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'contextual',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests contextual links.
*/
public function testBlockContentContextualLinks() {
$block_content = $this
->createBlockContent();
$block = $this
->placeBlock('block_content:' . $block_content
->uuid());
$user = $this
->drupalCreateUser([
'administer blocks',
'access contextual links',
]);
$this
->drupalLogin($user);
$this
->drupalGet('<front>');
$this
->assertSession()
->elementAttributeContains('css', 'div[data-contextual-id]', 'data-contextual-id', 'block:block=' . $block
->id() . ':langcode=en|block_content:block_content=' . $block_content
->id() . ':');
}
}