function StandardJavascriptTest::assertBigPipePlaceholderReplacementCount

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

Asserts the number of BigPipe placeholders that are replaced on the page.

Parameters

int $expected_count: The expected number of BigPipe placeholders.

1 call to StandardJavascriptTest::assertBigPipePlaceholderReplacementCount()
StandardJavascriptTest::testBigPipe in core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
Tests BigPipe accelerates particular Standard installation profile routes.

File

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

Class

StandardJavascriptTest
Tests Standard installation profile JavaScript expectations.

Namespace

Drupal\Tests\standard\FunctionalJavascript

Code

protected function assertBigPipePlaceholderReplacementCount($expected_count) {
    $web_assert = $this->assertSession();
    $web_assert->waitForElement('css', 'script[data-big-pipe-event="stop"]');
    $page = $this->getSession()
        ->getPage();
    $this->assertCount($expected_count, $this->getDrupalSettings()['bigPipePlaceholderIds']);
    $this->assertCount($expected_count, $page->findAll('css', 'script[data-big-pipe-replacement-for-placeholder-with-id]'));
}

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