Update to Drupal 8.0.6. For more information, see https://www.drupal.org/drupal-8.0.6-release-notes
This commit is contained in:
parent
4297c64508
commit
b11a755ba8
159 changed files with 2340 additions and 543 deletions
|
@ -33,10 +33,9 @@ class AdminRouteSubscriber extends RouteSubscriberBase {
|
|||
public static function getSubscribedEvents() {
|
||||
$events = parent::getSubscribedEvents();
|
||||
|
||||
// Use a higher priority than \Drupal\field_ui\Routing\RouteSubscriber or
|
||||
// \Drupal\views\EventSubscriber\RouteSubscriber to ensure we add the
|
||||
// option to their routes.
|
||||
// @todo https://www.drupal.org/node/2158571
|
||||
// Use a lower priority than \Drupal\field_ui\Routing\RouteSubscriber or
|
||||
// \Drupal\views\EventSubscriber\RouteSubscriber to ensure we add the option
|
||||
// to their routes.
|
||||
$events[RoutingEvents::ALTER] = array('onAlterRoutes', -200);
|
||||
|
||||
return $events;
|
||||
|
|
|
@ -12,6 +12,9 @@ use Drupal\Core\Entity\EntityInterface;
|
|||
|
||||
/**
|
||||
* Defines an abstract test base for entity unit tests.
|
||||
*
|
||||
* @deprecated in Drupal 8.1.x, will be removed before Drupal 8.2.x. Use
|
||||
* \Drupal\KernelTests\Core\Entity\EntityKernelTestBase instead.
|
||||
*/
|
||||
abstract class EntityUnitTestBase extends KernelTestBase {
|
||||
|
||||
|
|
|
@ -42,6 +42,27 @@ class ElementsTableSelectTest extends WebTestBase {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the presence of ajax functionality for all options.
|
||||
*/
|
||||
function testAjax() {
|
||||
$rows = array('row1', 'row2', 'row3');
|
||||
// Test checkboxes (#multiple == TRUE).
|
||||
foreach ($rows as $row) {
|
||||
$element = 'tableselect[' . $row . ']';
|
||||
$edit = array($element => TRUE);
|
||||
$result = $this->drupalPostAjaxForm('form_test/tableselect/multiple-true', $edit, $element);
|
||||
$this->assertFalse(empty($result), t('Ajax triggers on checkbox for @row.', array('@row' => $row)));
|
||||
}
|
||||
// Test radios (#multiple == FALSE).
|
||||
$element = 'tableselect';
|
||||
foreach ($rows as $row) {
|
||||
$edit = array($element => $row);
|
||||
$result = $this->drupalPostAjaxForm('form_test/tableselect/multiple-false', $edit, $element);
|
||||
$this->assertFalse(empty($result), t('Ajax triggers on radio for @row.', array('@row' => $row)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the display of radios when #multiple is FALSE.
|
||||
*/
|
||||
|
|
|
@ -412,7 +412,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
|
|||
* Return the URL for the authorize.php script.
|
||||
*
|
||||
* @param array $options
|
||||
* Optional array of options to pass to url().
|
||||
* Optional array of options to set on the \Drupal\Core\Url object.
|
||||
* @return \Drupal\Core\Url
|
||||
* The full URL to authorize.php, using HTTPS if available.
|
||||
*
|
||||
|
@ -431,7 +431,7 @@ function system_authorized_get_url(array $options = array()) {
|
|||
* Returns the URL for the authorize.php script when it is processing a batch.
|
||||
*
|
||||
* @param array $options
|
||||
* Optional array of options to pass to url().
|
||||
* Optional array of options to set on the \Drupal\Core\Url object.
|
||||
*
|
||||
* @return \Drupal\Core\Url
|
||||
*/
|
||||
|
|
|
@ -104,3 +104,10 @@ function form_test_form_form_test_vertical_tabs_access_form_alter(&$form, &$form
|
|||
$form['fieldset1']['#access'] = FALSE;
|
||||
$form['container']['#access'] = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax callback that returns the form element.
|
||||
*/
|
||||
function form_test_tableselect_ajax_callback($form, FormStateInterface $form_state) {
|
||||
return $form['tableselect'];
|
||||
}
|
||||
|
|
|
@ -34,11 +34,17 @@ abstract class FormTestTableSelectFormBase extends FormBase {
|
|||
$form['tableselect'] = $element_properties;
|
||||
|
||||
$form['tableselect'] += array(
|
||||
'#prefix' => '<div id="tableselect-wrapper">',
|
||||
'#suffix' => '</div>',
|
||||
'#type' => 'tableselect',
|
||||
'#header' => $header,
|
||||
'#options' => $options,
|
||||
'#multiple' => FALSE,
|
||||
'#empty' => t('Empty text.'),
|
||||
'#ajax' => array(
|
||||
'callback' => 'form_test_tableselect_ajax_callback',
|
||||
'wrapper' => 'tableselect-wrapper',
|
||||
),
|
||||
);
|
||||
|
||||
$form['submit'] = array(
|
||||
|
|
|
@ -86,4 +86,11 @@ class Test {
|
|||
throw new HttpException($code);
|
||||
}
|
||||
|
||||
public function error() {
|
||||
trigger_error('foo', E_USER_NOTICE);
|
||||
return [
|
||||
'#markup' => 'Content',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,3 +50,11 @@ test_page_test.http_response_exception:
|
|||
code: 200
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
|
||||
test_page_test.error:
|
||||
path: '/test-error'
|
||||
defaults:
|
||||
_controller: '\Drupal\test_page_test\Controller\Test::error'
|
||||
code: 200
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
services:
|
||||
theme_test.subscriber:
|
||||
class: Drupal\theme_test\EventSubscriber\ThemeTestSubscriber
|
||||
arguments: [@current_route_match, @renderer]
|
||||
arguments: ['@current_route_match', '@renderer']
|
||||
tags:
|
||||
- { name: event_subscriber }
|
||||
|
||||
|
|
|
@ -65,18 +65,28 @@ class PhpStorageFactoryTest extends KernelTestBase {
|
|||
$this->setSettings('test', array('bin' => NULL));
|
||||
$php = PhpStorageFactory::get('test');
|
||||
$this->assertTrue($php instanceof MockPhpStorage, 'An MockPhpStorage instance was returned from overridden settings.');
|
||||
$this->assertIdentical('test', $php->getConfigurationValue('bin'), 'Name value was used for bin.');
|
||||
$this->assertSame('test', $php->getConfigurationValue('bin'), 'Name value was used for bin.');
|
||||
|
||||
// Test that a default directory is set if it's empty.
|
||||
$this->setSettings('test', array('directory' => NULL));
|
||||
$php = PhpStorageFactory::get('test');
|
||||
$this->assertTrue($php instanceof MockPhpStorage, 'An MockPhpStorage instance was returned from overridden settings.');
|
||||
$this->assertIdentical(PublicStream::basePath() . '/php', $php->getConfigurationValue('directory'), 'Default file directory was used.');
|
||||
$this->assertSame(PublicStream::basePath() . '/php', $php->getConfigurationValue('directory'), 'Default file directory was used.');
|
||||
|
||||
// Test that a default storage class is set if it's empty.
|
||||
$this->setSettings('test', array('class' => NULL));
|
||||
$php = PhpStorageFactory::get('test');
|
||||
$this->assertTrue($php instanceof MTimeProtectedFileStorage, 'An MTimeProtectedFileStorage instance was returned from overridden settings with no class.');
|
||||
|
||||
// Test that a default secret is not returned if it's set in the override.
|
||||
$this->setSettings('test');
|
||||
$php = PhpStorageFactory::get('test');
|
||||
$this->assertNotEquals('mock hash salt', $php->getConfigurationValue('secret'), 'The default secret is not used if a secret is set in the overridden settings.');
|
||||
|
||||
// Test that a default secret is set if it's empty.
|
||||
$this->setSettings('test', array('secret' => NULL));
|
||||
$php = PhpStorageFactory::get('test');
|
||||
$this->assertSame('mock hash salt', $php->getConfigurationValue('secret'), 'The default secret is used if one is not set in the overridden settings.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,6 +104,7 @@ class PhpStorageFactoryTest extends KernelTestBase {
|
|||
'secret' => $this->randomString(),
|
||||
'bin' => 'test',
|
||||
);
|
||||
$settings['hash_salt'] = 'mock hash salt';
|
||||
new Settings($settings);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue