summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-01-21 07:36:34 (GMT)
committerNathaniel Catchpole2016-01-21 07:36:34 (GMT)
commit01b3613b24834eae7584aa679f358191a73e189a (patch)
tree82f8fc72631816ea276163d43a8fc2827f22accd
parentfc20eda5c4501824e9d1c533933ebe7070cb0eda (diff)
Issue #2641592 by Mac_Weber: Replace deprecated usage of entity_create('menu') with a direct call to Menu::create()
-rw-r--r--core/modules/menu_link_content/src/Tests/LinksTest.php3
-rw-r--r--core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php3
-rw-r--r--core/modules/menu_ui/src/Tests/MenuTest.php2
-rw-r--r--core/modules/system/src/Tests/Block/SystemMenuBlockTest.php4
4 files changed, 8 insertions, 4 deletions
diff --git a/core/modules/menu_link_content/src/Tests/LinksTest.php b/core/modules/menu_link_content/src/Tests/LinksTest.php
index 29a8d97..0c660e8 100644
--- a/core/modules/menu_link_content/src/Tests/LinksTest.php
+++ b/core/modules/menu_link_content/src/Tests/LinksTest.php
@@ -9,6 +9,7 @@ namespace Drupal\menu_link_content\Tests;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\simpletest\WebTestBase;
+use Drupal\system\Entity\Menu;
/**
* Tests handling of menu links hierarchies.
@@ -39,7 +40,7 @@ class LinksTest extends WebTestBase {
$this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
- entity_create('menu', array(
+ Menu::create(array(
'id' => 'menu_test',
'label' => 'Test menu',
'description' => 'Description text',
diff --git a/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php b/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php
index 520627e..5d9ce5f 100644
--- a/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php
@@ -9,6 +9,7 @@ namespace Drupal\menu_ui\Tests;
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 @@ class MenuCacheTagsTest extends PageCacheTagsTestBase {
$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',
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index d88911a..d350ab6 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -157,7 +157,7 @@ class MenuTest extends MenuWebTestBase {
$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',
diff --git a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
index e10a6af..4e6db75 100644
--- a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
+++ b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
@@ -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 @@ class SystemMenuBlockTest extends KernelTestBase {
$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',