3 namespace Drupal\Tests\migrate\Kernel;
5 use Drupal\comment\Entity\CommentType;
6 use Drupal\node\Entity\NodeType;
9 * Provides methods for testing node and comment combinations.
11 trait NodeCommentCombinationTrait {
14 * Creates a node type with a corresponding comment type.
16 * @param string $node_type
18 * @param string $comment_type
19 * (optional) The comment type ID, if not provided defaults to
20 * comment_node_{type}.
22 protected function createNodeCommentCombination($node_type, $comment_type = NULL) {
24 $comment_type = "comment_node_$node_type";
28 'label' => $this->randomString(),
32 'id' => $comment_type,
33 'label' => $this->randomString(),
34 'target_entity_type_id' => 'node',