public function SmartReadMoreLinkTest::testCreateArticleWithLongBody in Smart read more link 8
File
- tests/
src/ Functional/ SmartReadMoreLinkTest.php, line 75
Class
- SmartReadMoreLinkTest
- Functional tests of smart_read_more_link module.
Namespace
Drupal\Tests\smart_read_more_link\FunctionalCode
public function testCreateArticleWithLongBody() {
$body = $this
->paragraphs(12);
$node = Node::create([
'type' => 'article',
'title' => 'Test 2',
'body' => [
'summary' => '',
'value' => $this
->htmlParagraphs($body),
'format' => 'full_html',
],
]);
$node
->save();
$this
->drupalGet('/node/' . $node
->id());
$this
->assertParagraphs($body);
$this
->drupalGet('/node');
$this
->assertParagraphs([
$body[0],
]);
$this
->assertSession()
->linkExists('Read more');
}