Loading core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public static function largeContentBuilder() { * #lazy_builder callback; builds <time> markup with current time. * * @return array * Render array with a <time> markup with current time and cache settings. */ public static function currentTime() { return [ Loading core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class BigPipePlaceholderTestCases { * Optional. Necessary to get the embedded AJAX/HTML responses. * * @return \Drupal\big_pipe_test\BigPipePlaceholderTestCase[] * An array of placeholder test cases. */ public static function cases(?ContainerInterface $container = NULL, ?AccountInterface $user = NULL) { // Define the two types of cacheability that we expect to see. These will be Loading core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class BigPipeTestController implements TrustedCallbackInterface { * Returns all BigPipe placeholder test case render arrays. * * @return array * Render array containing various Big Pipe placeholder test cases. */ public function test() { $has_session = \Drupal::service('session_configuration')->hasSession(\Drupal::requestStack()->getMainRequest()); Loading Loading @@ -63,6 +64,7 @@ public function test() { /** * @return array * List of all BigPipe placeholder test cases. */ public static function nope() { return ['#markup' => '<p>Nope.</p>']; Loading @@ -74,6 +76,7 @@ public static function nope() { * @see \Drupal\Tests\big_pipe\Functional\BigPipeTest::testBigPipeMultiOccurrencePlaceholders() * * @return array * Render array with multiple placeholders using a lazy builder. */ public function multiOccurrence() { return [ Loading @@ -96,6 +99,9 @@ public function multiOccurrence() { * A page with placeholder preview. * * @return array[] * A render array with two containers: * - 'user_container': Loads the user’s display name via a lazy builder. * - 'user_links_container': Loads user links with a placeholder preview. */ public function placeholderPreview() { return [ Loading Loading @@ -129,6 +135,8 @@ public function placeholderPreview() { * Note: does not actually use current time, that would complicate testing. * * @return array * A render array containing a <time> element with a predefined date * and disabled caching for dynamic rendering. */ public static function currentTime() { return [ Loading @@ -141,6 +149,8 @@ public static function currentTime() { * #lazy_builder callback; suspends its own execution then returns markup. * * @return array * A render array with a pig-themed message wrapped in a <span>, * and caching disabled to ensure dynamic rendering. */ public static function piggy(): array { // Immediately call Fiber::suspend(), so that other placeholders are Loading @@ -159,6 +169,8 @@ public static function piggy(): array { * #lazy_builder callback; says "hello" or "hi". * * @return array * A render array with a marquee message using BigPipeMarkup, * with caching disabled and a custom cache tag. */ public static function helloOrHi() { return [ Loading @@ -185,6 +197,7 @@ public static function exception() { * @see \Drupal\big_pipe_test\EventSubscriber\BigPipeTestSubscriber::onRespondTriggerException() * * @return array * A render array with plain text for testing BigPipe error handling. */ public static function responseException() { return ['#plain_text' => BigPipeTestSubscriber::CONTENT_TRIGGER_EXCEPTION]; Loading core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -461,6 +461,7 @@ protected function setCsrfTokenSeedInTestEnvironment(): void { /** * @return \Drupal\big_pipe_test\BigPipePlaceholderTestCase[] * An array of test cases. */ protected function getTestCases($has_session = TRUE) { return BigPipePlaceholderTestCases::cases($this->container, $this->rootUser); Loading core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class TurtleLazyBuilder implements TrustedCallbackInterface { * Suspends its own execution twice to simulate long operation. * * @return array * The lazy builder callback. */ public static function turtle(): array { if (\Fiber::getCurrent() !== NULL) { Loading Loading
core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public static function largeContentBuilder() { * #lazy_builder callback; builds <time> markup with current time. * * @return array * Render array with a <time> markup with current time and cache settings. */ public static function currentTime() { return [ Loading
core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class BigPipePlaceholderTestCases { * Optional. Necessary to get the embedded AJAX/HTML responses. * * @return \Drupal\big_pipe_test\BigPipePlaceholderTestCase[] * An array of placeholder test cases. */ public static function cases(?ContainerInterface $container = NULL, ?AccountInterface $user = NULL) { // Define the two types of cacheability that we expect to see. These will be Loading
core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class BigPipeTestController implements TrustedCallbackInterface { * Returns all BigPipe placeholder test case render arrays. * * @return array * Render array containing various Big Pipe placeholder test cases. */ public function test() { $has_session = \Drupal::service('session_configuration')->hasSession(\Drupal::requestStack()->getMainRequest()); Loading Loading @@ -63,6 +64,7 @@ public function test() { /** * @return array * List of all BigPipe placeholder test cases. */ public static function nope() { return ['#markup' => '<p>Nope.</p>']; Loading @@ -74,6 +76,7 @@ public static function nope() { * @see \Drupal\Tests\big_pipe\Functional\BigPipeTest::testBigPipeMultiOccurrencePlaceholders() * * @return array * Render array with multiple placeholders using a lazy builder. */ public function multiOccurrence() { return [ Loading @@ -96,6 +99,9 @@ public function multiOccurrence() { * A page with placeholder preview. * * @return array[] * A render array with two containers: * - 'user_container': Loads the user’s display name via a lazy builder. * - 'user_links_container': Loads user links with a placeholder preview. */ public function placeholderPreview() { return [ Loading Loading @@ -129,6 +135,8 @@ public function placeholderPreview() { * Note: does not actually use current time, that would complicate testing. * * @return array * A render array containing a <time> element with a predefined date * and disabled caching for dynamic rendering. */ public static function currentTime() { return [ Loading @@ -141,6 +149,8 @@ public static function currentTime() { * #lazy_builder callback; suspends its own execution then returns markup. * * @return array * A render array with a pig-themed message wrapped in a <span>, * and caching disabled to ensure dynamic rendering. */ public static function piggy(): array { // Immediately call Fiber::suspend(), so that other placeholders are Loading @@ -159,6 +169,8 @@ public static function piggy(): array { * #lazy_builder callback; says "hello" or "hi". * * @return array * A render array with a marquee message using BigPipeMarkup, * with caching disabled and a custom cache tag. */ public static function helloOrHi() { return [ Loading @@ -185,6 +197,7 @@ public static function exception() { * @see \Drupal\big_pipe_test\EventSubscriber\BigPipeTestSubscriber::onRespondTriggerException() * * @return array * A render array with plain text for testing BigPipe error handling. */ public static function responseException() { return ['#plain_text' => BigPipeTestSubscriber::CONTENT_TRIGGER_EXCEPTION]; Loading
core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -461,6 +461,7 @@ protected function setCsrfTokenSeedInTestEnvironment(): void { /** * @return \Drupal\big_pipe_test\BigPipePlaceholderTestCase[] * An array of test cases. */ protected function getTestCases($has_session = TRUE) { return BigPipePlaceholderTestCases::cases($this->container, $this->rootUser); Loading
core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class TurtleLazyBuilder implements TrustedCallbackInterface { * Suspends its own execution twice to simulate long operation. * * @return array * The lazy builder callback. */ public static function turtle(): array { if (\Fiber::getCurrent() !== NULL) { Loading