public function ParagraphsCompositeRelationshipTest::assertParagraphField

Checks if $paragraph fields match with host / parent.

Parameters

$paragraph: The paragraph entity to check.

$id: The parent entity id.

$entity_type: The parent entity type.

$field_name: The parent entity field name.

1 call to ParagraphsCompositeRelationshipTest::assertParagraphField()
ParagraphsCompositeRelationshipTest::testParagraphsRevisions in paragraphs/tests/src/Kernel/ParagraphsCompositeRelationshipTest.php
Tests the revision of paragraphs.

File

paragraphs/tests/src/Kernel/ParagraphsCompositeRelationshipTest.php, line 342

Class

ParagraphsCompositeRelationshipTest
Tests the ERR composite relationship upgrade path.

Namespace

Drupal\Tests\paragraphs\Kernel

Code

public function assertParagraphField($paragraph, $id, $entity_type, $field_name) {
  self::assertEquals($paragraph['parent_id'][0]['value'], $id, 'Match parent id.');
  self::assertEquals($paragraph['parent_type'][0]['value'], $entity_type, 'Matching parent type.');
  self::assertEquals($paragraph['parent_field_name'][0]['value'], $field_name, 'Matching parent field name.');
}