function BlockContentRedirectTest::testRedirectDestination

Same name and namespace in other branches
  1. 11.x core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php \Drupal\Tests\block_content\Functional\Views\BlockContentRedirectTest::testRedirectDestination()
  2. 10 core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php \Drupal\Tests\block_content\Functional\Views\BlockContentRedirectTest::testRedirectDestination()
  3. 9 core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php \Drupal\Tests\block_content\Functional\Views\BlockContentRedirectTest::testRedirectDestination()
  4. 8.9.x core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php \Drupal\Tests\block_content\Functional\Views\BlockContentRedirectTest::testRedirectDestination()

Tests the redirect destination when editing block content.

File

core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php, line 37

Class

BlockContentRedirectTest
Tests the redirect destination on block content on entity operations.

Namespace

Drupal\Tests\block_content\Functional\Views

Code

public function testRedirectDestination() : void {
  $this->drupalLogin($this->drupalCreateUser([
    'access block library',
    'administer block content',
  ]));
  // Create a content block.
  $block = $this->createBlockContent();
  // Check the block content is present in the view redirect destination.
  $this->drupalGet('admin/content/redirect_destination');
  $this->assertSession()
    ->pageTextContains($block->label());
  // Edit the created block and save.
  $this->clickLink('Edit');
  $this->submitForm([], 'Save');
  $this->assertSession()
    ->addressEquals('admin/content/redirect_destination');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.