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:
Pantheon Automation 2016-01-06 16:31:26 -08:00 committed by Greg Anderson
parent 1a0e9d9fac
commit a6b049dd05
538 changed files with 5247 additions and 1594 deletions

View file

@ -235,8 +235,7 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
$this->streamWrappers = array();
\Drupal::unsetContainer();
// @see /core/tests/bootstrap.php
$this->classLoader = $GLOBALS['loader'];
$this->classLoader = require $this->root . '/autoload.php';
require_once $this->root . '/core/includes/bootstrap.inc';
@ -407,7 +406,7 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
// If the test is run with argument dburl then use it.
$db_url = getenv('SIMPLETEST_DB');
if (empty($db_url)) {
$this->markTestSkipped('There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.');
throw new \Exception('There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.');
}
else {
$database = Database::convertDbUrlToConnectionInfo($db_url, $this->root);
@ -509,7 +508,7 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
];
// @todo Use extension_loaded('apcu') for non-testbot
// https://www.drupal.org/node/2447753.
if (function_exists('apc_fetch')) {
if (function_exists('apcu_fetch')) {
$configuration['default']['cache_backend_class'] = ApcuFileCacheBackend::class;
}
}
@ -787,6 +786,12 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
/**
* Enables modules for this test.
*
* To install test modules outside of the testing environment, add
* @code
* $settings['extension_discovery_scan_tests'] = TRUE;
* @encode
* to your settings.php.
*
* @param string[] $modules
* A list of modules to enable. Dependencies are not resolved; i.e.,
* multiple modules have to be specified individually. The modules are only
@ -882,7 +887,8 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
// Update the kernel to remove their services.
$this->container->get('kernel')->updateModules($module_filenames, $module_filenames);
// Ensure isLoaded() is TRUE in order to make _theme() work.
// Ensure isLoaded() is TRUE in order to make
// \Drupal\Core\Theme\ThemeManagerInterface::render() work.
// Note that the kernel has rebuilt the container; this $module_handler is
// no longer the $module_handler instance from above.
$module_handler = $this->container->get('module_handler');
@ -1116,4 +1122,22 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser
}
}
/**
* 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 [];
}
}