class BigPipeSessionlessTestController in Sessionless BigPipe 8
Same name and namespace in other branches
- 2.x tests/modules/big_pipe_sessionless_test/src/BigPipeSessionlessTestController.php \Drupal\big_pipe_sessionless_test\BigPipeSessionlessTestController
Hierarchy
- class \Drupal\big_pipe_test\BigPipeTestController implements TrustedCallbackInterface
- class \Drupal\big_pipe_sessionless_test\BigPipeSessionlessTestController
Expanded class hierarchy of BigPipeSessionlessTestController
File
- tests/
modules/ big_pipe_sessionless_test/ src/ BigPipeSessionlessTestController.php, line 8
Namespace
Drupal\big_pipe_sessionless_testView source
class BigPipeSessionlessTestController extends BigPipeTestController {
/**
* {@inheritdoc}
*/
public function test() {
$build = parent::test();
$has_session = \Drupal::service('session_configuration')
->hasSession(\Drupal::requestStack()
->getMasterRequest());
// We can't test CSRF tokens for no-session requests.
if (!$has_session) {
unset($build['html_attribute_value_subset']);
}
// Edge case for no-session (and hence anonymous) responses: active links.
// @see \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter
$build['active_link'] = [
'#type' => 'link',
'#title' => 'This should be marked active',
'#url' => Url::fromRoute('big_pipe_sessionless_test'),
'#options' => [
'set_active_class' => TRUE,
],
];
$build['inactive_link'] = [
'#type' => 'link',
'#title' => 'This should be marked inactive',
'#url' => Url::fromRoute('<front>'),
'#options' => [
'set_active_class' => TRUE,
],
];
return $build;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BigPipeSessionlessTestController:: |
public | function |
Returns a all BigPipe placeholder test case render arrays. Overrides BigPipeTestController:: |
|
BigPipeTestController:: |
public static | function | #lazy_builder callback; returns the current count. | |
BigPipeTestController:: |
public static | function | #lazy_builder callback; builds <time> markup with current time. | |
BigPipeTestController:: |
public static | function | #lazy_builder callback; throws exception. | |
BigPipeTestController:: |
public static | function | #lazy_builder callback; says "hello" or "yarhar". | |
BigPipeTestController:: |
public | function | A page with multiple occurrences of the same placeholder. | |
BigPipeTestController:: |
public static | function | ||
BigPipeTestController:: |
public static | function | #lazy_builder callback; returns content that will trigger an exception. | |
BigPipeTestController:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |