Commit 38e1141c authored by catch's avatar catch

Issue #2636228 by alexpott: BrowserTestBase and KernelTestBase tests break badly when they fail

parent 421b4765
......@@ -1346,4 +1346,22 @@ protected function drupalUserIsLoggedIn(UserInterface $account) {
return $logged_in;
}
/**
* 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 array
* An empty array.
*
* @see vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist
*/
public function __sleep() {
return [];
}
}
......@@ -1116,4 +1116,22 @@ public function __get($name) {
}
}
/**
* Prevents serializing any properties.
*
* Kernel 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 array
* An empty array.
*
* @see vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist
*/
public function __sleep() {
return [];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment