You are here

public function BrowserTestBase::__sleep in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::__sleep()
  2. 9 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::__sleep()

Prevents serializing any properties.

Browser tests are run in a separate process. To do this PHPUnit creates a script to run the test. If it fails, the test result object will contain a stack trace which includes the test object. It will attempt to serialize it. Returning an empty array prevents it from serializing anything it should not.

Return value

array An empty array.

See also

vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist

File

core/tests/Drupal/Tests/BrowserTestBase.php, line 588

Class

BrowserTestBase
Provides a test case for functional Drupal tests.

Namespace

Drupal\Tests

Code

public function __sleep() {
  return [];
}