core/modules/rdf/rdf.module | 2 +- core/modules/rest/src/Tests/UpdateTest.php | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index ceda758..29ddec2 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -232,8 +232,8 @@ function rdf_comment_storage_load($comments) { // to optimize performance for websites that implement an entity cache. $created_mapping = rdf_get_mapping('comment', $comment->bundle()) ->getPreparedFieldMapping('created'); + /** @var \Drupal\comment\CommentInterface $comment*/ $comment->rdf_data['date'] = rdf_rdfa_attributes($created_mapping, $comment->get('created')->first()->toArray()); - /** @var \Drupal\Core\Entity\EntityInterface $entity */ $entity = $comment->getCommentedEntity(); $comment->rdf_data['entity_uri'] = $entity->toUrl()->toString(TRUE)->getGeneratedUrl(); if ($comment->hasParentComment()) { diff --git a/core/modules/rest/src/Tests/UpdateTest.php b/core/modules/rest/src/Tests/UpdateTest.php index ef91a55..6eab5f9 100644 --- a/core/modules/rest/src/Tests/UpdateTest.php +++ b/core/modules/rest/src/Tests/UpdateTest.php @@ -12,7 +12,7 @@ use Drupal\Component\Serialization\Json; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; -use Drupal\node\Entity\Node; +use Drupal\entity_test\Entity\EntityTest; /** * Tests the update of resources. @@ -35,7 +35,7 @@ class UpdateTest extends RESTTestBase { */ protected function setUp() { parent::setUp(); - $this->addDefaultCommentField('node', 'resttest'); + $this->addDefaultCommentField('entity_test', 'entity_test'); } /** @@ -254,13 +254,10 @@ public function testUpdateComment() { $this->drupalLogin($account); // Create & save an entity to comment on, plus a comment. - $node = Node::create([ - 'type' => 'resttest', - 'title' => 'some node', - ]); - $node->save(); + $entity_test = EntityTest::create(); + $entity_test->save(); $entity_values = $this->entityValues($entity_type); - $entity_values['entity_id'] = $node->id(); + $entity_values['entity_id'] = $entity_test->id(); $entity_values['uid'] = $account->id(); $comment = Comment::create($entity_values); $comment->save();