You are here

private function ForumTest::verifyForumView in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/src/Tests/ForumTest.php \Drupal\forum\Tests\ForumTest::verifyForumView()

Verifies the display of a forum page.

Parameters

array $forum: A row from the taxonomy_term_data table in an array.

array $parent: (optional) An array representing the forum's parent.

1 call to ForumTest::verifyForumView()
ForumTest::verifyForums in core/modules/forum/src/Tests/ForumTest.php
Verifies that the logged in user has access to a forum node.

File

core/modules/forum/src/Tests/ForumTest.php, line 652
Contains \Drupal\forum\Tests\ForumTest.

Class

ForumTest
Create, view, edit, delete, and change forum entries and verify its consistency in the database.

Namespace

Drupal\forum\Tests

Code

private function verifyForumView($forum, $parent = NULL) {

  // View forum page.
  $this
    ->drupalGet('forum/' . $forum['tid']);
  $this
    ->assertResponse(200);
  $this
    ->assertTitle($forum['name'] . ' | Drupal');
  $breadcrumb_build = array(
    Link::createFromRoute(t('Home'), '<front>'),
    Link::createFromRoute(t('Forums'), 'forum.index'),
  );
  if (isset($parent)) {
    $breadcrumb_build[] = Link::createFromRoute($parent['name'], 'forum.page', array(
      'taxonomy_term' => $parent['tid'],
    ));
  }
  $breadcrumb = array(
    '#theme' => 'breadcrumb',
    '#links' => $breadcrumb_build,
  );
  $this
    ->assertRaw(\Drupal::service('renderer')
    ->renderRoot($breadcrumb), 'Breadcrumbs were displayed');
}