You are here

public function SmartReadMoreLinkTest::testCreateArticleWithSummary in Smart read more link 8

File

tests/src/Functional/SmartReadMoreLinkTest.php, line 97

Class

SmartReadMoreLinkTest
Functional tests of smart_read_more_link module.

Namespace

Drupal\Tests\smart_read_more_link\Functional

Code

public function testCreateArticleWithSummary() {
  $body = $this
    ->paragraphs();
  $summary = $this
    ->paragraphs(1);
  $node = Node::create([
    'type' => 'article',
    'title' => 'Test 2',
    'body' => [
      'summary' => $this
        ->htmlParagraphs($summary),
      'value' => $this
        ->htmlParagraphs($body),
      'format' => 'full_html',
    ],
  ]);
  $node
    ->save();
  $this
    ->drupalGet('/node/' . $node
    ->id());
  $this
    ->assertParagraphs($body);
  $this
    ->drupalGet('/node');
  $this
    ->assertParagraphs($summary);
  $this
    ->assertSession()
    ->linkExists('Read more');
}