You are here

public function EntityAnalyserTest::testEntityPreviewWithSavedNode in Real-time SEO for Drupal 8.2

Tests that the entity preview works with saved nodes.

File

tests/src/Kernel/EntityAnalyserTest.php, line 117

Class

EntityAnalyserTest
Tests the entity analyzer.

Namespace

Drupal\Tests\yoast_seo\Kernel

Code

public function testEntityPreviewWithSavedNode() {
  $node = $this
    ->drupalCreateNode([
    'type' => 'article',
  ]);
  $preview_data = $this->entityAnalyzer
    ->createEntityPreview($node);
  $this
    ->assertNotEmpty($preview_data['title']);
  $this
    ->assertNotEmpty($preview_data['text']);
  $this
    ->assertNotEmpty($preview_data['url']);
}