function WaitTerminateTestTrait::setWaitForTerminate

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/WaitTerminateTestTrait.php \Drupal\Tests\WaitTerminateTestTrait::setWaitForTerminate()

Specify that subsequent requests must wait for the terminate event.

The terminate event is fired after a response is sent to the user agent. Tests with assertions which operate on data computed during the terminate event need to enable this.

7 calls to WaitTerminateTestTrait::setWaitForTerminate()
ConfigurableLanguageManagerTest::setUp in core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
CronRunTest::testAutomatedCron in core/modules/system/tests/src/Functional/System/CronRunTest.php
Ensure that the automated cron run module is working.
DisplayFeedTranslationTest::setUp in core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php
Sets up the test.
LocaleLocaleLookupTest::setUp in core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
NodeTest::testGetIndividual in core/modules/jsonapi/tests/src/Functional/NodeTest.php
Tests GETting an individual resource, plus edge cases to ensure good DX.

... See full list

File

core/tests/Drupal/Tests/WaitTerminateTestTrait.php, line 19

Class

WaitTerminateTestTrait
Provides a method to enforce that requests will wait for the terminate event.

Namespace

Drupal\Tests

Code

protected function setWaitForTerminate() {
    $this->container
        ->get('state')
        ->set('drupal.test_wait_terminate', TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.