You are here

protected function ParagraphListingTest::createParagraph in Paragraphs admin 8

Creates and saves a test paragraph.

Return value

\Drupal\Core\Entity\EntityInterface A paragraph entity.

1 call to ParagraphListingTest::createParagraph()
ParagraphListingTest::testParagraphListingPages in tests/src/Functional/ParagraphListingTest.php
Tests file overview with different user permissions.

File

tests/src/Functional/ParagraphListingTest.php, line 91

Class

ParagraphListingTest
Tests file listing page functionality.

Namespace

Drupal\Tests\paragraphs_admin\Functional

Code

protected function createParagraph() {

  // Create a new paragraph entity.
  $paragraph = Paragraph::create([
    'type' => 'paragraphed_test',
    'langcode' => 'en',
  ]);
  $paragraph
    ->save();
  return $paragraph;
}