function StandardJavascriptTest::testBigPipe

Same name in other branches
  1. 8.9.x core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php \Drupal\Tests\standard\FunctionalJavascript\StandardJavascriptTest::testBigPipe()
  2. 10 core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php \Drupal\Tests\standard\FunctionalJavascript\StandardJavascriptTest::testBigPipe()
  3. 11.x core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php \Drupal\Tests\standard\FunctionalJavascript\StandardJavascriptTest::testBigPipe()

Tests BigPipe accelerates particular Standard installation profile routes.

File

core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php, line 23

Class

StandardJavascriptTest
Tests Standard installation profile JavaScript expectations.

Namespace

Drupal\Tests\standard\FunctionalJavascript

Code

public function testBigPipe() {
    $this->drupalLogin($this->drupalCreateUser([
        'access content',
        'post comments',
        'skip comment approval',
    ]));
    $node = Node::create([
        'type' => 'article',
    ])->setTitle($this->randomMachineName())
        ->setPromoted(TRUE)
        ->setPublished();
    $node->save();
    // Front page: one placeholder, for messages.
    $this->drupalGet('');
    $this->assertBigPipePlaceholderReplacementCount(1);
    // Node page: 2 placeholders:
    // 1. messages
    // 2. comment form
    $this->drupalGet($node->toUrl());
    $this->assertBigPipePlaceholderReplacementCount(2);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.