Backup of db before drupal security update
[yaffs-website] / web / core / modules / block_content / tests / src / Functional / Views / BlockContentRedirectTest.php
1 <?php
2
3 namespace Drupal\Tests\block_content\Functional\Views;
4
5 /**
6  * Tests the redirect destination on block content on entity operations.
7  *
8  * @group block_content
9  */
10 class BlockContentRedirectTest extends BlockContentTestBase {
11
12   /**
13    * Views used by this test.
14    *
15    * @var array
16    */
17   public static $testViews = ['test_block_content_redirect_destination'];
18
19   /**
20    * Modules to enable.
21    *
22    * @var array
23    */
24   public static $modules = ['block', 'block_content', 'views'];
25
26   /**
27    * Tests the redirect destination when editing block content.
28    */
29   public function testRedirectDestination() {
30     $this->drupalLogin($this->drupalCreateUser(['administer blocks']));
31     $this->drupalGet('admin/structure/block/block-content');
32
33     // Create a custom block.
34     $this->clickLink('custom block');
35     $edit = [];
36     $edit['info[0][value]'] = 'Test redirect destination';
37     $edit['body[0][value]'] = $this->randomMachineName(16);
38     $this->drupalPostForm(NULL, $edit, 'Save');
39
40     // Check the block content is present in the view redirect destination.
41     $this->drupalGet('admin/content/redirect_destination');
42     $this->assertText('Test redirect destination');
43
44     // Edit the created block and save.
45     $this->clickLink('Edit');
46     $this->drupalPostForm(NULL, [], 'Save');
47     $this->assertUrl('admin/content/redirect_destination');
48   }
49
50 }