Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668
This commit is contained in:
parent
f32e58e4b1
commit
8e18df8c36
3062 changed files with 15044 additions and 172506 deletions
|
@ -46,24 +46,28 @@ div.simpletest-pass {
|
|||
color: #981010;
|
||||
}
|
||||
|
||||
tr.simpletest-pass,
|
||||
tr.simpletest-pass.odd {
|
||||
background-color: #b6ffb6;
|
||||
}
|
||||
tr.simpletest-pass.even {
|
||||
background-color: #9bff9b;
|
||||
}
|
||||
tr.simpletest-fail,
|
||||
tr.simpletest-fail.odd {
|
||||
background-color: #ffc9c9;
|
||||
}
|
||||
tr.simpletest-fail.even {
|
||||
background-color: #ffacac;
|
||||
}
|
||||
tr.simpletest-exception,
|
||||
tr.simpletest-exception.odd {
|
||||
background-color: #f4ea71;
|
||||
}
|
||||
tr.simpletest-exception.even {
|
||||
background-color: #f5e742;
|
||||
}
|
||||
tr.simpletest-debug,
|
||||
tr.simpletest-debug.odd {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
(function ($) {
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Collapses table rows followed by group rows on the test listing page.
|
||||
|
@ -83,7 +83,7 @@
|
|||
* @type {Drupal~behavior}
|
||||
*
|
||||
* @prop {Drupal~behaviorAttach} attach
|
||||
* Attaches the filter behavior the the text input element.
|
||||
* Attaches the filter behavior to the text input element.
|
||||
*/
|
||||
Drupal.behaviors.simpletestTableFilterByText = {
|
||||
attach: function (context) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use Drupal\Core\Asset\AttachedAssetsInterface;
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Core\Extension\ExtensionDiscovery;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\simpletest\TestBase;
|
||||
|
@ -179,7 +178,9 @@ function simpletest_run_tests($test_list) {
|
|||
function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames) {
|
||||
$phpunit_file = simpletest_phpunit_xml_filepath($test_id);
|
||||
$ret = simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file);
|
||||
if ($ret) {
|
||||
// A return value of 0 = passed test, 1 = failed test, > 1 indicates segfault
|
||||
// timeout, or other type of failure.
|
||||
if ($ret > 1) {
|
||||
// Something broke during the execution of phpunit.
|
||||
// Return an error record of all failed classes.
|
||||
$rows[] = [
|
||||
|
|
|
@ -182,6 +182,33 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
protected $customTranslations;
|
||||
|
||||
/*
|
||||
* Mink class for the default driver to use.
|
||||
*
|
||||
* Shoud be a fully qualified class name that implements
|
||||
* Behat\Mink\Driver\DriverInterface.
|
||||
*
|
||||
* Value can be overridden using the environment variable MINK_DRIVER_CLASS.
|
||||
*
|
||||
* @var string.
|
||||
*/
|
||||
protected $minkDefaultDriverClass = '\Behat\Mink\Driver\GoutteDriver';
|
||||
|
||||
/*
|
||||
* Mink default driver params.
|
||||
*
|
||||
* If it's an array its contents are used as constructor params when default
|
||||
* Mink driver class is instantiated.
|
||||
*
|
||||
* Can be overridden using the environment variable MINK_DRIVER_ARGS. In this
|
||||
* case that variable should be a JSON array, for example:
|
||||
* '["firefox", null, "http://localhost:4444/wd/hub"]'.
|
||||
*
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $minkDefaultDriverArgs;
|
||||
|
||||
/**
|
||||
* Mink session manager.
|
||||
*
|
||||
|
@ -193,15 +220,51 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
* Initializes Mink sessions.
|
||||
*/
|
||||
protected function initMink() {
|
||||
$driver = new GoutteDriver();
|
||||
$driver = $this->getDefaultDriverInstance();
|
||||
$session = new Session($driver);
|
||||
$this->mink = new Mink();
|
||||
$this->mink->registerSession('goutte', $session);
|
||||
$this->mink->setDefaultSessionName('goutte');
|
||||
$this->mink->registerSession('default', $session);
|
||||
$this->mink->setDefaultSessionName('default');
|
||||
$this->registerSessions();
|
||||
return $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an instance of the default Mink driver.
|
||||
*
|
||||
* @return Behat\Mink\Driver\DriverInterface
|
||||
* Instance of default Mink driver.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* When provided default Mink driver class can't be instantiated.
|
||||
*/
|
||||
protected function getDefaultDriverInstance() {
|
||||
// Get default driver params from environment if availables.
|
||||
if ($arg_json = getenv('MINK_DRIVER_ARGS')) {
|
||||
$this->minkDefaultDriverArgs = json_decode($arg_json);
|
||||
}
|
||||
|
||||
// Get and check default driver class from environment if availables.
|
||||
if ($minkDriverClass = getenv('MINK_DRIVER_CLASS')) {
|
||||
if (class_exists($minkDriverClass)) {
|
||||
$this->minkDefaultDriverClass = $minkDriverClass;
|
||||
}
|
||||
else {
|
||||
throw new \InvalidArgumentException("Can't instantiate provided $minkDriverClass class by environment as default driver class.");
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($this->minkDefaultDriverArgs)) {
|
||||
// Use ReflectionClass to instantiate class with received params.
|
||||
$reflector = new ReflectionClass($this->minkDefaultDriverClass);
|
||||
$driver = $reflector->newInstanceArgs($this->minkDefaultDriverArgs);
|
||||
}
|
||||
else {
|
||||
$driver = new $this->minkDefaultDriverClass();
|
||||
}
|
||||
return $driver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers additional Mink sessions.
|
||||
*
|
||||
|
@ -1194,7 +1257,7 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase {
|
|||
$server = array_merge($server, $override_server_vars);
|
||||
|
||||
$request = Request::create($request_path, 'GET', array(), array(), array(), $server);
|
||||
// Ensure the the request time is REQUEST_TIME to ensure that API calls
|
||||
// Ensure the request time is REQUEST_TIME to ensure that API calls
|
||||
// in the test use the right timestamp.
|
||||
$request->server->set('REQUEST_TIME', REQUEST_TIME);
|
||||
$this->container->get('request_stack')->push($request);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\simpletest\Form;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Database\Connection;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormState;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\simpletest\Form;
|
||||
|
||||
use Drupal\Component\Utility\SortArray;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Render\RendererInterface;
|
||||
|
|
|
@ -322,6 +322,7 @@ EOD;
|
|||
$container
|
||||
->register('simpletest.config_schema_checker', 'Drupal\Core\Config\Testing\ConfigSchemaChecker')
|
||||
->addArgument(new Reference('config.typed'))
|
||||
->addArgument($this->getConfigSchemaExclusions())
|
||||
->addTag('event_subscriber');
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\simpletest;
|
|||
|
||||
use Drupal\Component\Render\MarkupInterface;
|
||||
use Drupal\Component\Utility\Crypt;
|
||||
use Drupal\Component\Utility\Random;
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Core\Config\ConfigImporter;
|
||||
|
@ -295,6 +294,22 @@ abstract class TestBase {
|
|||
*/
|
||||
protected $strictConfigSchema = TRUE;
|
||||
|
||||
/**
|
||||
* An array of config object names that are excluded from schema checking.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $configSchemaCheckerExclusions = array(
|
||||
// Following are used to test lack of or partial schema. Where partial
|
||||
// schema is provided, that is explicitly tested in specific tests.
|
||||
'config_schema_test.noschema',
|
||||
'config_schema_test.someschema',
|
||||
'config_schema_test.schema_data_types',
|
||||
'config_schema_test.no_schema_data_types',
|
||||
// Used to test application of schema to filtering of configuration.
|
||||
'config_test.dynamic.system',
|
||||
);
|
||||
|
||||
/**
|
||||
* HTTP authentication method (specified as a CURLAUTH_* constant).
|
||||
*
|
||||
|
@ -1586,4 +1601,23 @@ abstract class TestBase {
|
|||
return $this->tempFilesDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the config schema exclusions for this test.
|
||||
*
|
||||
* @return string[]
|
||||
* An array of config object names that are excluded from schema checking.
|
||||
*/
|
||||
protected function getConfigSchemaExclusions() {
|
||||
$class = get_class($this);
|
||||
$exceptions = [];
|
||||
while ($class) {
|
||||
if (property_exists($class, 'configSchemaCheckerExclusions')) {
|
||||
$exceptions = array_merge($exceptions, $class::$configSchemaCheckerExclusions);
|
||||
}
|
||||
$class = get_parent_class($class);
|
||||
}
|
||||
// Filter out any duplicates.
|
||||
return array_unique($exceptions);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -680,14 +680,11 @@ abstract class WebTestBase extends TestBase {
|
|||
// Initialize user 1 and session name.
|
||||
$this->initUserSession();
|
||||
|
||||
// Get parameters for install_drupal() before removing global variables.
|
||||
$parameters = $this->installParameters();
|
||||
|
||||
// Prepare the child site settings.
|
||||
$this->prepareSettings();
|
||||
|
||||
// Execute the non-interactive installer.
|
||||
$this->doInstall($parameters);
|
||||
$this->doInstall();
|
||||
|
||||
// Import new settings.php written by the installer.
|
||||
$this->initSettings();
|
||||
|
@ -711,12 +708,9 @@ abstract class WebTestBase extends TestBase {
|
|||
/**
|
||||
* Execute the non-interactive installer.
|
||||
*
|
||||
* @param array $parameters
|
||||
* Parameters to pass to install_drupal().
|
||||
*
|
||||
* @see install_drupal()
|
||||
*/
|
||||
protected function doInstall(array $parameters = []) {
|
||||
protected function doInstall() {
|
||||
require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
|
||||
install_drupal($this->classLoader, $this->installParameters());
|
||||
}
|
||||
|
@ -785,7 +779,7 @@ abstract class WebTestBase extends TestBase {
|
|||
$services = $yaml->parse($content);
|
||||
$services['services']['simpletest.config_schema_checker'] = [
|
||||
'class' => 'Drupal\Core\Config\Testing\ConfigSchemaChecker',
|
||||
'arguments' => ['@config.typed'],
|
||||
'arguments' => ['@config.typed', $this->getConfigSchemaExclusions()],
|
||||
'tags' => [['name' => 'event_subscriber']]
|
||||
];
|
||||
file_put_contents($directory . '/services.yml', $yaml->dump($services));
|
||||
|
@ -812,6 +806,10 @@ abstract class WebTestBase extends TestBase {
|
|||
// TestBase::restoreEnvironment() will delete the entire site directory.
|
||||
// Not using File API; a potential error must trigger a PHP warning.
|
||||
chmod(DRUPAL_ROOT . '/' . $this->siteDirectory, 0777);
|
||||
|
||||
// During tests, cacheable responses should get the debugging cacheability
|
||||
// headers by default.
|
||||
$this->setContainerParameter('http.response.debug_cacheability_headers', TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2921,7 +2919,7 @@ abstract class WebTestBase extends TestBase {
|
|||
$server = array_merge($server, $override_server_vars);
|
||||
|
||||
$request = Request::create($request_path, 'GET', array(), array(), array(), $server);
|
||||
// Ensure the the request time is REQUEST_TIME to ensure that API calls
|
||||
// Ensure the request time is REQUEST_TIME to ensure that API calls
|
||||
// in the test use the right timestamp.
|
||||
$request->server->set('REQUEST_TIME', REQUEST_TIME);
|
||||
$this->container->get('request_stack')->push($request);
|
||||
|
@ -3019,4 +3017,18 @@ abstract class WebTestBase extends TestBase {
|
|||
$this->assertFalse(in_array($cache_tag, $cache_tags), "'" . $cache_tag . "' is absent in the X-Drupal-Cache-Tags header.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the cacheability headers.
|
||||
*
|
||||
* Sets the http.response.debug_cacheability_headers container parameter.
|
||||
*
|
||||
* @param bool $value
|
||||
* (optional) Whether the debugging cacheability headers should be sent.
|
||||
*/
|
||||
protected function setHttpResponseDebugCacheabilityHeaders($value = TRUE) {
|
||||
$this->setContainerParameter('http.response.debug_cacheability_headers', $value);
|
||||
$this->rebuildContainer();
|
||||
$this->resetAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class SimpletestPhpunitRunCommandTestWillDie extends UnitTestCase {
|
|||
|
||||
public function testWillDie() {
|
||||
if (getenv('SimpletestPhpunitRunCommandTestWillDie') === 'fail') {
|
||||
exit(1);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue