public function ParagraphsCollectionDemoTest::testDemoNode

Tests the "Paragraphs Collection Demo Article!" demo node.

File

paragraphs_collection/modules/paragraphs_collection_demo/tests/src/Functional/ParagraphsCollectionDemoTest.php, line 126

Class

ParagraphsCollectionDemoTest
Test the demo for Paragraphs Collection.

Namespace

Drupal\Tests\paragraphs_collection_demo\Functional

Code

public function testDemoNode() {
  $this
    ->loginAsAdmin([
    'edit any paragraphed_content_demo content',
    'administer lockable paragraph',
    'use text format basic_html',
  ]);

  // Edit and save "Paragraphs Collection Demo Article!" to test validity.
  $this
    ->drupalGet('node/1/edit');
  $this
    ->assertSession()
    ->pageTextContains('Edit Paragraphed Content Demo Paragraphs Collection Demo Article!');
  $this
    ->submitForm([], 'field_paragraphs_demo_0_edit');
  $this
    ->submitForm([], 'field_paragraphs_demo_0_subform_paragraphs_container_paragraphs_0_duplicate');
  $this
    ->submitForm([], 'Save');
  $this
    ->assertSession()
    ->pageTextContains('Paragraphed Content Demo Paragraphs Collection Demo Article! has been updated.');
}