public function BlockContentPageViewTest::testPageEdit in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/block_content/src/Tests/BlockContentPageViewTest.php \Drupal\block_content\Tests\BlockContentPageViewTest::testPageEdit()
Checks block edit and fallback functionality.
File
- core/
modules/ block_content/ src/ Tests/ BlockContentPageViewTest.php, line 27 - Contains \Drupal\block_content\Tests\BlockContentPageViewTest.
Class
- BlockContentPageViewTest
- Create a block and test block access by attempting to view the block.
Namespace
Drupal\block_content\TestsCode
public function testPageEdit() {
$this
->drupalLogin($this->adminUser);
$block = $this
->createBlockContent();
// Attempt to view the block.
$this
->drupalGet('block-content/' . $block
->id());
// Assert response was '200' and not '403 Access denied'.
$this
->assertResponse('200', 'User was able the view the block');
$this
->drupalGet('<front>');
$this
->assertRaw(t('This block is broken or missing. You may be missing content or you might need to enable the original module.'));
}