Commit 01b3613b authored by catch's avatar catch

Issue #2641592 by Mac_Weber: Replace deprecated usage of ...

Issue #2641592 by Mac_Weber: Replace deprecated usage of  entity_create('menu') with a direct call to Menu::create()
parent fc20eda5
......@@ -9,6 +9,7 @@
use Drupal\Component\Utility\SafeMarkup;
use Drupal\simpletest\WebTestBase;
use Drupal\system\Entity\Menu;
/**
* Tests handling of menu links hierarchies.
......@@ -39,7 +40,7 @@ protected function setUp() {
$this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
entity_create('menu', array(
Menu::create(array(
'id' => 'menu_test',
'label' => 'Test menu',
'description' => 'Description text',
......
......@@ -9,6 +9,7 @@
use Drupal\Core\Url;
use Drupal\system\Tests\Cache\PageCacheTagsTestBase;
use Drupal\system\Entity\Menu;
/**
* Tests the Menu and Menu Link entities' cache tags.
......@@ -32,7 +33,7 @@ public function testMenuBlock() {
$url = Url::fromRoute('test_page_test.test_page');
// Create a Llama menu, add a link to it and place the corresponding block.
$menu = entity_create('menu', array(
$menu = Menu::create(array(
'id' => 'llama',
'label' => 'Llama',
'description' => 'Description text',
......
......@@ -157,7 +157,7 @@ function addCustomMenuCRUD() {
$menu_name = substr(hash('sha256', $this->randomMachineName(16)), 0, MENU_MAX_MENU_NAME_LENGTH_UI);
$label = $this->randomMachineName(16);
$menu = entity_create('menu', array(
$menu = Menu::create(array(
'id' => $menu_name,
'label' => $label,
'description' => 'Description text',
......
......@@ -6,6 +6,8 @@
namespace Drupal\system\Tests\Block;
use Drupal\system\Entity\Menu;
use Drupal\Core\Render\Element;
use Drupal\simpletest\KernelTestBase;
use Drupal\system\Tests\Routing\MockRouteProvider;
......@@ -118,7 +120,7 @@ protected function setUp() {
$menu_name = 'mock';
$label = $this->randomMachineName(16);
$this->menu = entity_create('menu', array(
$this->menu = Menu::create(array(
'id' => $menu_name,
'label' => $label,
'description' => 'Description text',
......
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