You are here

public function ParagraphsCollectionDemoTest::testDemoNode in Paragraphs Collection 8

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

File

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
    ->drupalPostForm(NULL, [], 'field_paragraphs_demo_0_edit');
  $this
    ->drupalPostForm(NULL, [], 'field_paragraphs_demo_0_subform_paragraphs_container_paragraphs_0_duplicate');
  $this
    ->drupalPostForm(NULL, [], 'Save');
  $this
    ->assertSession()
    ->pageTextContains('Paragraphed Content Demo Paragraphs Collection Demo Article! has been updated.');
}