Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / block_content / tests / src / Functional / BlockContentPageViewTest.php
1 <?php
2
3 namespace Drupal\Tests\block_content\Functional;
4
5 /**
6  * Create a block and test block access by attempting to view the block.
7  *
8  * @group block_content
9  */
10 class BlockContentPageViewTest extends BlockContentTestBase {
11
12   /**
13    * Modules to enable.
14    *
15    * @var array
16    */
17   public static $modules = ['block_content_test'];
18
19   /**
20    * Checks block edit and fallback functionality.
21    */
22   public function testPageEdit() {
23     $this->drupalLogin($this->adminUser);
24     $block = $this->createBlockContent();
25
26     // Attempt to view the block.
27     $this->drupalGet('block-content/' . $block->id());
28
29     // Assert response was '200' and not '403 Access denied'.
30     $this->assertResponse('200', 'User was able the view the block');
31     $this->drupalGet('<front>');
32     $this->assertRaw(t('This block is broken or missing. You may be missing content or you might need to enable the original module.'));
33   }
34
35 }