diff --git a/core/profiles/standard/src/Tests/StandardTest.php b/core/profiles/standard/src/Tests/StandardTest.php index f8d4999ea0b..07cbd0f4703 100644 --- a/core/profiles/standard/src/Tests/StandardTest.php +++ b/core/profiles/standard/src/Tests/StandardTest.php @@ -10,6 +10,7 @@ namespace Drupal\standard\Tests; use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\contact\Entity\ContactForm; use Drupal\simpletest\WebTestBase; +use Drupal\user\Entity\Role; /** * Tests Standard installation profile expectations. @@ -22,6 +23,13 @@ class StandardTest extends WebTestBase { protected $profile = 'standard'; + /** + * The admin user. + * + * @var \Drupal\user\UserInterface + */ + protected $adminUser; + /** * Tests Standard installation profile. */ @@ -32,12 +40,14 @@ class StandardTest extends WebTestBase { $this->assertResponse(200); // Test anonymous user can access 'Main navigation' block. - $admin = $this->drupalCreateUser(array( + $this->adminUser = $this->drupalCreateUser(array( 'administer blocks', 'post comments', 'skip comment approval', + 'create article content', + 'create page content', )); - $this->drupalLogin($admin); + $this->drupalLogin($this->adminUser); // Configure the block. $this->drupalGet('admin/structure/block/add/system_menu_block:main/bartik'); $this->drupalPostForm(NULL, array( @@ -79,7 +89,7 @@ class StandardTest extends WebTestBase { )); // Add a comment. - $this->drupalLogin($admin); + $this->drupalLogin($this->adminUser); $this->drupalGet('node/1'); $this->drupalPostForm(NULL, array( 'subject[0][value]' => 'Barfoo', @@ -120,6 +130,17 @@ class StandardTest extends WebTestBase { $contact_form = ContactForm::load('feedback'); $recipients = $contact_form->getRecipients(); $this->assertEqual(['simpletest@example.com'], $recipients); + + $role = Role::create([ + 'id' => 'admin_theme', + 'label' => 'Admin theme', + ]); + $role->grantPermission('view the administration theme'); + $role->save(); + $this->adminUser->addRole($role->id()); + $this->adminUser->save(); + $this->drupalGet('node/add'); + $this->assertResponse(200); } } diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 53cf3147580..621cf8248fc 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -72,10 +72,11 @@ function seven_preprocess_menu_local_task(&$variables) { */ function seven_preprocess_node_add_list(&$variables) { if (!empty($variables['content'])) { + /** @var \Drupal\node\NodeTypeInterface $type */ foreach ($variables['content'] as $type) { - $variables['types'][$type->type]['label'] = String::checkPlain($type->name); - $variables['types'][$type->type]['description'] = Xss::filterAdmin($type->description); - $variables['types'][$type->type]['url'] = \Drupal::url('node.add', array('node_type' => $type->type)); + $variables['types'][$type->id()]['label'] = String::checkPlain($type->label()); + $variables['types'][$type->id()]['description'] = Xss::filterAdmin($type->getDescription()); + $variables['types'][$type->id()]['url'] = \Drupal::url('node.add', array('node_type' => $type->id())); } } }