protected function BigPipeTest::assertBigPipeNoJsPlaceholders in Drupal 10
Same name and namespace in other branches
- 8 core/modules/big_pipe/tests/src/Functional/BigPipeTest.php \Drupal\Tests\big_pipe\Functional\BigPipeTest::assertBigPipeNoJsPlaceholders()
- 9 core/modules/big_pipe/tests/src/Functional/BigPipeTest.php \Drupal\Tests\big_pipe\Functional\BigPipeTest::assertBigPipeNoJsPlaceholders()
Asserts expected BigPipe no-JS placeholders are present and replaced.
@internal
Parameters
array $expected_big_pipe_nojs_placeholders: Keys: BigPipe no-JS placeholder markup. Values: expected replacement markup.
File
- core/
modules/ big_pipe/ tests/ src/ Functional/ BigPipeTest.php, line 344
Class
- BigPipeTest
- Tests BigPipe's no-JS detection & response delivery (with and without JS).
Namespace
Drupal\Tests\big_pipe\FunctionalCode
protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders) : void {
$this
->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this
->getSession()
->getResponseHeader('BigPipe-Test-No-Js-Placeholders'))));
foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) {
// Checking whether the replacement for the BigPipe no-JS placeholder
// $big_pipe_nojs_placeholder is present.
$this
->assertSession()
->responseNotContains($big_pipe_nojs_placeholder);
if ($expected_replacement !== NULL) {
$this
->assertSession()
->responseContains($expected_replacement);
}
}
}