function BrowserTestBase::__sleep
Same name in other branches
- 9 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::__sleep()
- 10 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::__sleep()
- 11.x 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 596
Class
- BrowserTestBase
- Provides a test case for functional Drupal tests.
Namespace
Drupal\TestsCode
public function __sleep() {
return [];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.