You are here

class BigPipeRegressionTestController in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php \Drupal\big_pipe_regression_test\BigPipeRegressionTestController

Hierarchy

Expanded class hierarchy of BigPipeRegressionTestController

1 file declares its use of BigPipeRegressionTestController
BigPipeRegressionTest.php in core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php

File

core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php, line 8

Namespace

Drupal\big_pipe_regression_test
View source
class BigPipeRegressionTestController implements TrustedCallbackInterface {
  const MARKER_2678662 = '<script>var hitsTheFloor = "</body>";</script>';

  /**
   * @see \Drupal\Tests\big_pipe\FunctionalJavascript\BigPipeRegressionTest::testMultipleBodies_2678662()
   */
  public function regression2678662() {
    return [
      '#markup' => BigPipeMarkup::create(self::MARKER_2678662),
    ];
  }

  /**
   * @see \Drupal\Tests\big_pipe\FunctionalJavascript\BigPipeRegressionTest::testMultipleBodies_2678662()
   */
  public function regression2802923() {
    return [
      '#prefix' => BigPipeMarkup::create('<p>Hi, my train will arrive at '),
      'time' => [
        '#lazy_builder' => [
          static::class . '::currentTime',
          [],
        ],
        '#create_placeholder' => TRUE,
      ],
      '#suffix' => BigPipeMarkup::create(' — will I still be able to catch the connection to the center?</p>'),
    ];
  }

  /**
   * #lazy_builder callback; builds <time> markup with current time.
   *
   * @return array
   */
  public static function currentTime() {
    return [
      '#markup' => '<time datetime="' . date('Y-m-d', time()) . '"></time>',
      '#cache' => [
        'max-age' => 0,
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return [
      'currentTime',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BigPipeRegressionTestController::currentTime public static function #lazy_builder callback; builds <time> markup with current time.
BigPipeRegressionTestController::MARKER_2678662 constant
BigPipeRegressionTestController::regression2678662 public function
BigPipeRegressionTestController::regression2802923 public function
BigPipeRegressionTestController::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.