You are here

protected function DisplayJsonFeedTest::setUp in JSON Feed 8

Overrides ViewTestBase::setUp

File

tests/src/Functional/DisplayJsonFeedTest.php, line 79

Class

DisplayJsonFeedTest
Tests the json_feed display plugin.

Namespace

Drupal\Tests\json_feed\Functional

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp();
  ViewTestData::createTestViews(get_class($this), [
    'json_feed_test_views',
  ]);
  $admin_user = $this
    ->drupalCreateUser([
    'administer site configuration',
  ], self::ADMIN_NAME);
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalCreateContentType([
    'type' => 'page',
  ]);
  $node_data = [
    'title' => 'This "cool" & "neat" article\'s title',
    'body' => [
      0 => [
        // Verify content with HTML entities is properly escaped.
        'value' => '<p>A <em>paragraph</em>.</p>',
        'format' => filter_default_format(),
      ],
    ],
  ];
  for ($i = 0; $i < $this->nodesToCreate; $i++) {
    $this
      ->drupalCreateNode($node_data);
  }
}