Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023

This commit is contained in:
Pantheon Automation 2015-09-04 13:20:09 -07:00 committed by Greg Anderson
parent 2720a9ec4b
commit f3791f1da3
1898 changed files with 54300 additions and 11481 deletions

View file

@ -7,7 +7,7 @@
namespace Drupal\menu_ui\Controller;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Menu\MenuParentFormSelectorInterface;
use Drupal\system\MenuInterface;
@ -73,11 +73,11 @@ class MenuController extends ControllerBase {
* @param \Drupal\system\MenuInterface $menu
* The menu entity.
*
* @return string
* The menu label.
* @return array
* The menu label as a render array.
*/
public function menuTitle(MenuInterface $menu) {
return SafeMarkup::xssFilter($menu->label());
return ['#markup' => $menu->label(), '#allowed_tags' => Xss::getHtmlTagList()];
}
}

View file

@ -36,7 +36,7 @@ class MenuListBuilder extends ConfigEntityListBuilder {
*/
public function buildRow(EntityInterface $entity) {
$row['title'] = array(
'data' => $this->getLabel($entity),
'data' => $entity->label(),
'class' => array('menu-label'),
);
$row['description']['data'] = ['#markup' => $entity->getDescription()];

View file

@ -0,0 +1,71 @@
<?php
/**
* @file
* Contains \Drupal\menu_ui\Tests\MenuLinkReorderTest.
*/
namespace Drupal\menu_ui\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Reorder menu items.
*
* @group menu_ui
*/
class MenuLinkReorderTest extends WebTestBase {
/**
* An administrator user.
*
* @var \Drupal\user\UserInterface
*/
protected $administrator;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('menu_ui', 'test_page_test', 'node', 'block');
/**
* Test creating, editing, deleting menu links via node form widget.
*/
function testDefaultMenuLinkReorder() {
// Add the main menu block.
$this->drupalPlaceBlock('system_menu_block:main');
// Assert that the Home link is available.
$this->drupalGet('test-page');
$this->assertLink('Home');
// The administrator user that can re-order menu links.
$this->administrator = $this->drupalCreateUser(array(
'administer site configuration',
'access administration pages',
'administer menu',
));
$this->drupalLogin($this->administrator);
// Change the weight of the link to a non default value.
$edit = array(
'links[menu_plugin_id:test_page_test.front_page][weight]' => -10,
);
$this->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));
// The link is still there.
$this->drupalGet('test-page');
$this->assertLink('Home');
// Clear all caches.
$this->drupalPostForm('admin/config/development/performance', [], t('Clear all caches'));
// Clearing all caches should not affect the state of the menu link.
$this->drupalGet('test-page');
$this->assertLink('Home');
}
}

View file

@ -139,7 +139,7 @@ class MenuNodeTest extends WebTestBase {
'edit any page content',
]);
$this->drupalLogin($admin_user);
foreach ([t('Save and unpublish') => FALSE, t('Save and keep unpublished') => FALSE, t('Save and publish') => TRUE, t('Save and keep published') => TRUE] as $submit => $visible) {
foreach (['Save and unpublish' => FALSE, 'Save and keep unpublished' => FALSE, 'Save and publish' => TRUE, 'Save and keep published' => TRUE] as $submit => $visible) {
$edit = [
'menu[enabled]' => 1,
'menu[title]' => $node_title,

View file

@ -243,9 +243,10 @@ class MenuTest extends MenuWebTestBase {
$this->assertResponse(200);
$this->assertRaw(t('The menu %title has been deleted.', array('%title' => $label)), 'Custom menu was deleted');
$this->assertNull(Menu::load($menu_name), 'Custom menu was deleted');
// Test if all menu links associated to the menu were removed from database.
// Test if all menu links associated with the menu were removed from
// database.
$result = entity_load_multiple_by_properties('menu_link_content', array('menu_name' => $menu_name));
$this->assertFalse($result, 'All menu links associated to the custom menu were deleted.');
$this->assertFalse($result, 'All menu links associated with the custom menu were deleted.');
// Make sure there's no delete button on system menus.
$this->drupalGet('admin/structure/menu/manage/main');

View file

@ -0,0 +1,34 @@
<?php
/**
* @file
* Contains \Drupal\menu_ui\Tests\Migrate\MigrateMenuSettingsTest.
*/
namespace Drupal\menu_ui\Tests\Migrate;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of menu_ui settings.
*
* @group menu_ui
*/
class MigrateMenuSettingsTest extends MigrateDrupal7TestBase {
public static $modules = ['menu_ui'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(['menu_ui']);
$this->executeMigration('menu_settings');
}
public function testMigration() {
$this->assertTrue(\Drupal::config('menu_ui.settings')->get('override_parent_selector'));
}
}