Commit 2ecea882 authored by alexpott's avatar alexpott
Browse files

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

Issue #2641540 by Mac_Weber: Replace deprecated usage of  entity_create('entity_test_mulrev') with a direct call to  EntityTestMulRev::create()
parent e495c490
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\serialization\Tests; namespace Drupal\serialization\Tests;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\entity_test\Entity\EntityTestMulRev;
/** /**
* Tests that entities references can be resolved. * Tests that entities references can be resolved.
...@@ -57,7 +58,7 @@ protected function setUp() { ...@@ -57,7 +58,7 @@ protected function setUp() {
*/ */
function testUuidEntityResolver() { function testUuidEntityResolver() {
// Create an entity to get the UUID from. // 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('name', 'foobar');
$entity->set('field_test_entity_reference', array(array('target_id' => 1))); $entity->set('field_test_entity_reference', array(array('target_id' => 1)));
$entity->save(); $entity->save();
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Drupal\serialization\Tests; namespace Drupal\serialization\Tests;
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
use Drupal\entity_test\Entity\EntityTestMulRev;
/** /**
* Tests that entities can be serialized to supported core formats. * Tests that entities can be serialized to supported core formats.
...@@ -81,7 +82,7 @@ protected function setUp() { ...@@ -81,7 +82,7 @@ protected function setUp() {
'format' => 'full_html', 'format' => 'full_html',
), ),
); );
$this->entity = entity_create('entity_test_mulrev', $this->values); $this->entity = EntityTestMulRev::create($this->values);
$this->entity->save(); $this->entity->save();
$this->serializer = $this->container->get('serializer'); $this->serializer = $this->container->get('serializer');
......
...@@ -123,7 +123,7 @@ protected function setUp() { ...@@ -123,7 +123,7 @@ protected function setUp() {
// decimal 13 is binary 1101 so unit 3,2 and 0 will be added to the // decimal 13 is binary 1101 so unit 3,2 and 0 will be added to the
// entity. // entity.
for ($i = 1; $i <= 15; $i++) { for ($i = 1; $i <= 15; $i++) {
$entity = entity_create('entity_test_mulrev', array( $entity = EntityTestMulRev::create(array(
'type' => $bundles[$i & 1], 'type' => $bundles[$i & 1],
'name' => $this->randomMachineName(), 'name' => $this->randomMachineName(),
'langcode' => 'en', 'langcode' => 'en',
......
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