Issue #3333569 by alorenc, lauriii, smustgrave, larowlan: Breadcrumb for local tasks of Custom Blocks should contain the name of the custom block not the entity ID
parent
89eb557574
commit
bfe3f5dc98
|
@ -22,6 +22,7 @@ entity.block_content.canonical:
|
|||
path: '/block/{block_content}'
|
||||
defaults:
|
||||
_entity_form: 'block_content.edit'
|
||||
_title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
|
||||
options:
|
||||
_admin_route: TRUE
|
||||
requirements:
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Drupal\Tests\block_content\Functional;
|
||||
|
||||
use Drupal\block_content\Entity\BlockContent;
|
||||
use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait;
|
||||
|
||||
/**
|
||||
* Create a block and test block edit functionality.
|
||||
|
@ -11,6 +12,8 @@ use Drupal\block_content\Entity\BlockContent;
|
|||
*/
|
||||
class PageEditTest extends BlockContentTestBase {
|
||||
|
||||
use AssertBreadcrumbTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -23,6 +26,7 @@ class PageEditTest extends BlockContentTestBase {
|
|||
parent::setUp();
|
||||
|
||||
$this->drupalPlaceBlock('page_title_block');
|
||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,6 +81,15 @@ class PageEditTest extends BlockContentTestBase {
|
|||
$this->drupalGet("block/" . $revised_block->id());
|
||||
$this->clickLink('Delete');
|
||||
$this->assertSession()->pageTextContains('Are you sure you want to delete the custom block ' . $revised_block->label() . '?');
|
||||
|
||||
// Test breadcrumb.
|
||||
$trail = [
|
||||
'' => 'Home',
|
||||
'block/' . $revised_block->id() => $revised_block->label(),
|
||||
];
|
||||
$this->assertBreadcrumb(
|
||||
'block/' . $revised_block->id() . '/delete', $trail
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2175,6 +2175,11 @@ parameters:
|
|||
count: 2
|
||||
path: modules/system/tests/modules/entity_test/entity_test.install
|
||||
|
||||
-
|
||||
message: "#^Variable \\$goto in isset\\(\\) always exists and is not nullable\\.$#"
|
||||
count: 1
|
||||
path: modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php
|
||||
|
||||
-
|
||||
message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
|
||||
count: 1
|
||||
|
|
Loading…
Reference in New Issue