doAdminTests example

    $this->drupalGet('/forum');
    // Look for the "General discussion" default forum     $this->assertSession()->linkExists('General discussion');
    $this->assertSession()->linkByHrefExists('/forum/1');
    // Check the presence of expected cache tags.     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:forum.settings');

    $this->drupalGet(Url::fromRoute('forum.page', ['taxonomy_term' => 1]));
    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:forum.settings');

    // Do the admin tests.     $this->doAdminTests($this->adminUser);

    // Check display order.     $display = EntityViewDisplay::load('node.forum.default');
    $body = $display->getComponent('body');
    $comment = $display->getComponent('comment_forum');
    $taxonomy = $display->getComponent('taxonomy_forums');

    // Assert field order is body » taxonomy » comments.     $this->assertLessThan($body['weight']$taxonomy['weight']);
    $this->assertLessThan($comment['weight']$body['weight']);

    
Home | Imprint | This part of the site doesn't use cookies.