function BlockContentRedirectTest::testBlockContentDeleteRedirect

Tests the deprecation message from the old block delete page.

@group legacy

File

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

Class

BlockContentRedirectTest
Ensures that custom block type functions work correctly.

Namespace

Drupal\Tests\block_content\Functional

Code

public function testBlockContentDeleteRedirect() : void {
  $block = $this->createBlockContent();
  $this->drupalLogin($this->adminUser);
  $this->expectDeprecation('The path /block/{block_content} is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/content/block/{block_content}. See https://www.drupal.org/node/3320855');
  $this->drupalGet("/block/{$block->id()}/delete");
  $this->assertSession()
    ->pageTextContains("You have been redirected from block/{$block->id()}/delete. Update links, shortcuts, and bookmarks to use admin/content/block/{$block->id()}/delete.");
}

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