BlockContentRedirectTest.php in Drupal 8
File
core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php
View source
<?php
namespace Drupal\Tests\block_content\Functional\Views;
class BlockContentRedirectTest extends BlockContentTestBase {
public static $testViews = [
'test_block_content_redirect_destination',
];
public static $modules = [
'block',
'block_content',
'views',
];
protected $defaultTheme = 'stark';
public function testRedirectDestination() {
$this
->drupalLogin($this
->drupalCreateUser([
'administer blocks',
]));
$this
->drupalGet('admin/structure/block/block-content');
$this
->clickLink('custom block');
$edit = [];
$edit['info[0][value]'] = 'Test redirect destination';
$edit['body[0][value]'] = $this
->randomMachineName(16);
$this
->drupalPostForm(NULL, $edit, 'Save');
$this
->drupalGet('admin/content/redirect_destination');
$this
->assertText('Test redirect destination');
$this
->clickLink('Edit');
$this
->drupalPostForm(NULL, [], 'Save');
$this
->assertUrl('admin/content/redirect_destination');
}
}