BlockContentPageViewTest.php
Same filename in other branches
Namespace
Drupal\Tests\block_content\FunctionalFile
-
core/
modules/ block_content/ tests/ src/ Functional/ BlockContentPageViewTest.php
View source
<?php
namespace Drupal\Tests\block_content\Functional;
/**
* Create a block and test block access by attempting to view the block.
*
* @group block_content
*/
class BlockContentPageViewTest extends BlockContentTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'block_content_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Checks block edit and fallback functionality.
*/
public function testPageEdit() {
$this->drupalLogin($this->adminUser);
$block = $this->createBlockContent();
// Attempt to view the block.
$this->drupalGet('block-content/' . $block->id());
// Ensure user was able to view the block.
$this->assertSession()
->statusCodeEquals(200);
$this->drupalGet('<front>');
$this->assertSession()
->pageTextContains('This block is broken or missing. You may be missing content or you might need to enable the original module.');
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
BlockContentPageViewTest | Create a block and test block access by attempting to view the block. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.