3 namespace Drupal\block_content\Tests\Views;
6 * Tests the redirect destination on block content on entity operations.
10 class BlockContentRedirectTest extends BlockContentTestBase {
13 * Views used by this test.
17 public static $testViews = ['test_block_content_redirect_destination'];
24 public static $modules = ['block', 'block_content', 'views'];
27 * Tests the redirect destination when editing block content.
29 public function testRedirectDestination() {
30 $this->drupalLogin($this->drupalCreateUser(['administer blocks']));
31 $this->drupalGet('admin/structure/block/block-content');
33 // Create a custom block.
34 $this->clickLink('custom block');
36 $edit['info[0][value]'] = 'Test redirect destination';
37 $edit['body[0][value]'] = $this->randomMachineName(16);
38 $this->drupalPostForm(NULL, $edit, 'Save');
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');
44 // Edit the created block and save.
45 $this->clickLink('Edit');
46 $this->drupalPostForm(NULL, [], 'Save');
47 $this->assertUrl('admin/content/redirect_destination');