public function ParagraphsCompositeRelationshipTest::assertParagraphField in Paragraphs 8
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 tests/
src/ Kernel/ ParagraphsCompositeRelationshipTest.php - Tests the revision of paragraphs.
File
- tests/
src/ Kernel/ ParagraphsCompositeRelationshipTest.php, line 342
Class
- ParagraphsCompositeRelationshipTest
- Tests the ERR composite relationship upgrade path.
Namespace
Drupal\Tests\paragraphs\KernelCode
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.');
}