diff --git a/core/modules/node/lib/Drupal/node/Controller/NodeController.php b/core/modules/node/lib/Drupal/node/Controller/NodeController.php index 4267101..92733fb 100644 --- a/core/modules/node/lib/Drupal/node/Controller/NodeController.php +++ b/core/modules/node/lib/Drupal/node/Controller/NodeController.php @@ -153,7 +153,7 @@ protected function buildPage(NodeInterface $node) { * The page title. */ public function addPageTitle(NodeTypeInterface $node_type) { - return $this->t('Create @name', array('@name' => $node_type->type)); + return $this->t('Create @name', array('@name' => $node_type->label())); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php index 5589b1c..0ae7c73 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php @@ -7,6 +7,8 @@ namespace Drupal\node\Tests; +use Drupal\Component\Utility\String; + /** * Tests related to node types. */ @@ -51,17 +53,21 @@ function testNodeTypeGetFunctions() { */ function testNodeTypeCreation() { // Create a content type programmaticaly. - $type = $this->drupalCreateContentType(); + $type = $this->drupalCreateContentType(array('name' => $this->randomName())); $type_exists = (bool) entity_load('node_type', $type->type); $this->assertTrue($type_exists, 'The new content type has been created in the database.'); // Login a test user. - $web_user = $this->drupalCreateUser(array('create ' . $type->name . ' content')); + $web_user = $this->drupalCreateUser(array('create ' . $type->type . ' content')); $this->drupalLogin($web_user); $this->drupalGet('node/add/' . $type->type); $this->assertResponse(200, 'The new content type can be accessed at node/add.'); + $this->assertTitle(implode(' | ', array( + 'title' => t('Create @name', array('@name' => $type->label())), + 'name' => String::checkPlain(\Drupal::config('system.site')->get('name')), + ))); // Create a content type via the user interface. $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types'));