Commit 4d80891f authored by alexpott's avatar alexpott

Issue #2855636 by idebr, Pavan B S, chiranjeeb2410, nikunjkotecha, NikitaJain,...

Issue #2855636 by idebr, Pavan B S, chiranjeeb2410, nikunjkotecha, NikitaJain, hugovk, krknth, xjm: Regression: incorrect human-readable name for content type
parent 00e2631b
......@@ -79,6 +79,7 @@ entity.block_content_type.edit_form:
path: '/admin/structure/block/block-content/manage/{block_content_type}'
defaults:
_entity_form: 'block_content_type.edit'
_title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
requirements:
_entity_access: 'block_content_type.update'
......
......@@ -4,6 +4,8 @@
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Component\Utility\Html;
use Drupal\Core\Url;
use Drupal\system\Tests\Menu\AssertBreadcrumbTrait;
/**
* Ensures that custom block type functions work correctly.
......@@ -12,6 +14,7 @@
*/
class BlockContentTypeTest extends BlockContentTestBase {
use AssertBreadcrumbTrait;
/**
* Modules to enable.
*
......@@ -91,6 +94,7 @@ public function testBlockContentTypeCreation() {
* Tests editing a block type using the UI.
*/
public function testBlockContentTypeEditing() {
$this->drupalPlaceBlock('system_breadcrumb_block');
// Now create an initial block-type.
$this->createBlockContentType('basic', TRUE);
......@@ -113,6 +117,13 @@ public function testBlockContentTypeEditing() {
$this->drupalGet('admin/structure/block/block-content/manage/basic');
$this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic']));
$this->drupalPostForm(NULL, $edit, t('Save'));
$front_page_path = Url::fromRoute('<front>')->toString();
$this->assertBreadcrumb('admin/structure/block/block-content/manage/basic/fields', [
$front_page_path => 'Home',
'admin/structure/block' => 'Block layout',
'admin/structure/block/block-content' => 'Custom block library',
'admin/structure/block/block-content/manage/basic' => 'Bar',
]);
\Drupal::entityManager()->clearCachedFieldDefinitions();
$this->drupalGet('block/add');
......
......@@ -113,6 +113,7 @@ entity.node_type.edit_form:
path: '/admin/structure/types/manage/{node_type}'
defaults:
_entity_form: 'node_type.edit'
_title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
requirements:
_permission: 'administer content types'
......
......@@ -5,6 +5,7 @@
use Drupal\field\Entity\FieldConfig;
use Drupal\node\Entity\NodeType;
use Drupal\Core\Url;
use Drupal\system\Tests\Menu\AssertBreadcrumbTrait;
/**
* Ensures that node type functions work correctly.
......@@ -13,12 +14,14 @@
*/
class NodeTypeTest extends NodeTestBase {
use AssertBreadcrumbTrait;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['field_ui'];
public static $modules = ['field_ui', 'block'];
/**
* Ensures that node type functions (node_type_get_*) work correctly.
......@@ -84,6 +87,7 @@ public function testNodeTypeCreation() {
* Tests editing a node type using the UI.
*/
public function testNodeTypeEditing() {
$this->drupalPlaceBlock('system_breadcrumb_block');
$web_user = $this->drupalCreateUser(['bypass node access', 'administer content types', 'administer node fields']);
$this->drupalLogin($web_user);
......@@ -134,6 +138,12 @@ public function testNodeTypeEditing() {
$this->drupalPostForm('admin/structure/types/manage/page/fields/node.page.body/delete', [], t('Delete'));
// Resave the settings for this type.
$this->drupalPostForm('admin/structure/types/manage/page', [], t('Save content type'));
$front_page_path = Url::fromRoute('<front>')->toString();
$this->assertBreadcrumb('admin/structure/types/manage/page/fields', [
$front_page_path => 'Home',
'admin/structure/types' => 'Content types',
'admin/structure/types/manage/page' => 'NewBar',
]);
// Check that the body field doesn't exist.
$this->drupalGet('node/add/page');
$this->assertNoRaw('Body', 'Body field was not found.');
......@@ -143,6 +153,7 @@ public function testNodeTypeEditing() {
* Tests deleting a content type that still has content.
*/
public function testNodeTypeDeletion() {
$this->drupalPlaceBlock('page_title_block');
// Create a content type programmatically.
$type = $this->drupalCreateContentType();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment