public function NodeViewTest::testViewPremiumNodeInTeaserViewMode in Node Option Premium 8
Tests that a read more link is shown in teasers for premium nodes.
File
- tests/
src/ Kernel/ NodeViewTest.php, line 129
Class
- NodeViewTest
- Tests displaying nodes.
Namespace
Drupal\Tests\nopremium\KernelCode
public function testViewPremiumNodeInTeaserViewMode() {
// Create a premium node.
$node = $this
->createNodeWithBodyValue('Lorem ipsum', [
'premium' => TRUE,
]);
$build = $this->viewBuilder
->view($node, 'teaser');
$output = (string) $this->renderer
->renderPlain($build);
// And ensure that there is a read more link.
$this
->assertStringContainsString('Read more', $output);
}