You are here

protected function StandardJavascriptTest::assertBigPipePlaceholderReplacementCount in Drupal 10

Same name and namespace in other branches
  1. 8 core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php \Drupal\Tests\standard\FunctionalJavascript\StandardJavascriptTest::assertBigPipePlaceholderReplacementCount()
  2. 9 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.

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) : void {
  $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]'));
}