From 82ea52673c3ea48cd4fd1f65578b597289802b1b Mon Sep 17 00:00:00 2001
From: Mac_Weber <Mac_Weber@789986.no-reply.drupal.org>
Date: Mon, 28 Dec 2015 21:07:50 -0200
Subject: [PATCH] Issue #2641540 by Mac_Weber: Replace deprecated usage of
 entity_create('entity_test_mulrev') with a direct call to
 EntityTestMulRev::create()

---
 core/modules/serialization/src/Tests/EntityResolverTest.php      | 3 ++-
 core/modules/serialization/src/Tests/EntitySerializationTest.php | 3 ++-
 core/modules/system/src/Tests/Entity/EntityQueryTest.php         | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php
index f63d96d..8863d15 100644
--- a/core/modules/serialization/src/Tests/EntityResolverTest.php
+++ b/core/modules/serialization/src/Tests/EntityResolverTest.php
@@ -7,6 +7,7 @@
 namespace Drupal\serialization\Tests;
 
 use Drupal\Core\Url;
+use Drupal\Core\Entity\Entity\EntityTestMulRev;
 
 /**
  * Tests that entities references can be resolved.
@@ -57,7 +58,7 @@ protected function setUp() {
    */
   function testUuidEntityResolver() {
     // Create an entity to get the UUID from.
-    $entity = entity_create('entity_test_mulrev', array('type' => 'entity_test_mulrev'));
+    $entity = EntityTestMulRev::create(array('type' => 'entity_test_mulrev'));
     $entity->set('name', 'foobar');
     $entity->set('field_test_entity_reference', array(array('target_id' => 1)));
     $entity->save();
diff --git a/core/modules/serialization/src/Tests/EntitySerializationTest.php b/core/modules/serialization/src/Tests/EntitySerializationTest.php
index 1dbc51c..cacc960 100644
--- a/core/modules/serialization/src/Tests/EntitySerializationTest.php
+++ b/core/modules/serialization/src/Tests/EntitySerializationTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\serialization\Tests;
 
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Core\Entity\Entity\EntityTestMulRev;
 
 /**
  * Tests that entities can be serialized to supported core formats.
@@ -81,7 +82,7 @@ protected function setUp() {
         'format' => 'full_html',
       ),
     );
-    $this->entity = entity_create('entity_test_mulrev', $this->values);
+    $this->entity = EntityTestMulRev::create($this->values);
     $this->entity->save();
 
     $this->serializer = $this->container->get('serializer');
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 3124f54..4bd10a9 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Core\Entity\Entity\EntityTestMulRev;
+
 use Drupal\Component\Utility\Unicode;
 use Drupal\entity_test\Entity\EntityTestMulRev;
 use Drupal\field\Entity\FieldConfig;
@@ -123,7 +125,7 @@ protected function setUp() {
     // decimal 13 is binary 1101 so unit 3,2 and 0 will be added to the
     // entity.
     for ($i = 1; $i <= 15; $i++) {
-      $entity = entity_create('entity_test_mulrev', array(
+      $entity = EntityTestMulRev::create(array(
         'type' => $bundles[$i & 1],
         'name' => $this->randomMachineName(),
         'langcode' => 'en',
-- 
2.1.4

