Update to Drupal 8.0.2. For more information, see https://www.drupal.org/drupal-8.0.2-release-notes
This commit is contained in:
parent
1a0e9d9fac
commit
a6b049dd05
538 changed files with 5247 additions and 1594 deletions
|
|
@ -41,11 +41,6 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
* Drupal\Tests\yourmodule\Functional namespace and live in the
|
||||
* modules/yourmodule/Tests/Functional directory.
|
||||
*
|
||||
* All BrowserTestBase tests must have two annotations to ensure process
|
||||
* isolation:
|
||||
* - @runTestsInSeparateProcesses
|
||||
* - @preserveGlobalState disabled
|
||||
*
|
||||
* @ingroup testing
|
||||
*
|
||||
* @see \Drupal\simpletest\WebTestBase
|
||||
|
|
@ -216,6 +211,19 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
protected $mink;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* Browser tests are run in separate processes to prevent collisions between
|
||||
* code that may be loaded by tests.
|
||||
*/
|
||||
protected $runTestInSeparateProcess = TRUE;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $preserveGlobalState = FALSE;
|
||||
|
||||
/**
|
||||
* Initializes Mink sessions.
|
||||
*/
|
||||
|
|
@ -291,7 +299,7 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
// coverage against.
|
||||
$base_url = getenv('SIMPLETEST_BASE_URL');
|
||||
if (!$base_url) {
|
||||
$this->markTestSkipped(
|
||||
throw new \Exception(
|
||||
'You must provide a SIMPLETEST_BASE_URL environment variable to run some PHPUnit based functional tests.'
|
||||
);
|
||||
}
|
||||
|
|
@ -800,24 +808,6 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override to use Mink exceptions.
|
||||
*
|
||||
* @return mixed
|
||||
* Either a test result or NULL.
|
||||
*
|
||||
* @throws \PHPUnit_Framework_AssertionFailedError
|
||||
* When exception was thrown inside the test.
|
||||
*/
|
||||
protected function runTest() {
|
||||
try {
|
||||
return parent::runTest();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
throw new \PHPUnit_Framework_AssertionFailedError($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs Drupal into the Simpletest site.
|
||||
*/
|
||||
|
|
@ -1338,4 +1328,22 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
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 [];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue