From fa4f05d0c36173afc60700aebb2d992e67e21b39 Mon Sep 17 00:00:00 2001 From: Mac_Weber Date: Mon, 28 Dec 2015 17:25:47 -0200 Subject: [PATCH] Issue #2641534 by Mac_Weber: Replace deprecated usage of entity_create('entity_test_label') with a direct call to EntityTestLabel::create() --- .../src/Tests/EntityReference/EntityReferenceFormatterTest.php | 3 ++- .../src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php index cc41f7d..bd2f3e3 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php @@ -15,6 +15,7 @@ use Drupal\system\Tests\Entity\EntityUnitTestBase; use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; +use Drupal\Core\Entity\Entity\EntityTestLabel; /** * Tests the formatters functionality. @@ -259,7 +260,7 @@ public function testLabelFormatter() { $field_storage_config->setSetting('target_type', 'entity_test_label'); $field_storage_config->save(); - $referenced_entity_with_no_link_template = entity_create('entity_test_label', array( + $referenced_entity_with_no_link_template = EntityTestLabel::create(array( 'name' => $this->randomMachineName(), )); $referenced_entity_with_no_link_template->save(); diff --git a/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php b/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php index 66fd3c2..f8e0778 100644 --- a/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php +++ b/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Entity\EntityStorageException; use Drupal\simpletest\KernelTestBase; +use Drupal\Core\Entity\Entity\EntityTestLabel; /** * Tests KeyValueEntityStorage for content entities. @@ -73,7 +74,7 @@ function testCRUD() { } // Verify that an entity with an empty ID string is considered empty, too. - $empty_id = entity_create('entity_test_label', array( + $empty_id = EntityTestLabel::create(array( 'id' => '', )); $this->assertIdentical($empty_id->isNew(), TRUE); @@ -86,7 +87,7 @@ function testCRUD() { } // Verify properties on a newly created entity. - $entity_test = entity_create('entity_test_label', $expected = array( + $entity_test = EntityTestLabel::create($expected = array( 'id' => $this->randomMachineName(), 'name' => $this->randomString(), )); @@ -129,7 +130,7 @@ function testCRUD() { // Ensure that creating an entity with the same id as an existing one is not // possible. - $same_id = entity_create('entity_test_label', array( + $same_id = EntityTestLabel::create(array( 'id' => $entity_test->id(), )); $this->assertIdentical($same_id->isNew(), TRUE); -- 2.1.4