Update to Drupal 8.0.5. For more information, see https://www.drupal.org/node/2679347
This commit is contained in:
parent
2a9f1f148d
commit
fd3b12cf27
251 changed files with 5439 additions and 957 deletions
|
@ -62,6 +62,16 @@ class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
|
|||
$this->assertIdentical('Email Field', $field->label());
|
||||
$this->assertIdentical('benjy@example.com', $entity->field_test_email->value);
|
||||
|
||||
// Test image field.
|
||||
$field = FieldConfig::load('node.story.field_test_imagefield');
|
||||
$this->assertIdentical('Image Field', $field->label());
|
||||
$field_settings = $field->getSettings();
|
||||
$this->assertIdentical('', $field_settings['max_resolution']);
|
||||
$this->assertIdentical('', $field_settings['min_resolution']);
|
||||
$this->assertIdentical('', $field_settings['file_directory']);
|
||||
$this->assertIdentical('png gif jpg jpeg', $field_settings['file_extensions']);
|
||||
$this->assertIdentical('public', $field_settings['uri_scheme']);
|
||||
|
||||
// Test a filefield.
|
||||
$field = FieldConfig::load('node.story.field_test_filefield');
|
||||
$this->assertIdentical('File Field', $field->label());
|
||||
|
|
|
@ -56,6 +56,7 @@ class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase {
|
|||
$component = $form_display->getComponent('field_test_email');
|
||||
$expected['type'] = 'email_default';
|
||||
$expected['weight'] = 6;
|
||||
$expected['settings'] = array('placeholder' => '', 'size' => 60);
|
||||
$this->assertIdentical($expected, $component);
|
||||
|
||||
// Link field.
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\field\Tests\Update\EmailWidgetSizeSettingUpdateTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\field\Tests\Update;
|
||||
|
||||
use Drupal\system\Tests\Update\UpdatePathTestBase;
|
||||
|
||||
/**
|
||||
* Tests the update for the 'size' setting of the 'email_default' field widget.
|
||||
*
|
||||
* @group field
|
||||
*/
|
||||
class EmailWidgetSizeSettingUpdateTest extends UpdatePathTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setDatabaseDumpFiles() {
|
||||
$this->databaseDumpFiles = [
|
||||
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
|
||||
__DIR__ . '/../../../tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests field_post_update_email_widget_size_setting().
|
||||
*
|
||||
* @see field_post_update_email_widget_size_setting()
|
||||
*/
|
||||
public function testFieldPostUpdateEmailWidgetSizeSetting() {
|
||||
$configFactory = $this->container->get('config.factory');
|
||||
|
||||
// Load the 'node.article.default' entity form display and check that the
|
||||
// widget for 'field_email_2578741' does not have a 'size' setting.
|
||||
/** @var \Drupal\Core\Config\Config $config */
|
||||
$config = $configFactory->get('core.entity_form_display.node.article.default');
|
||||
$settings = $config->get('content.field_email_2578741.settings');
|
||||
$this->assertTrue(!isset($settings['size']), 'The size setting does not exist prior to running the update functions.');
|
||||
|
||||
// Run updates.
|
||||
$this->runUpdates();
|
||||
|
||||
// Reload the config and check that the 'size' setting has been populated.
|
||||
$config = $configFactory->get('core.entity_form_display.node.article.default');
|
||||
$settings = $config->get('content.field_email_2578741.settings');
|
||||
$this->assertEqual($settings['size'], 60, 'The size setting exists and it has the correct default value.');
|
||||
}
|
||||
|
||||
}
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
namespace Drupal\field\Tests\Views;
|
||||
|
||||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\views\Views;
|
||||
|
||||
/**
|
||||
|
@ -112,4 +114,32 @@ class FieldUITest extends FieldTestBase {
|
|||
$this->assertEqual($options, array('format', 'value'), 'The expected sort field options were found.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests adding a boolean field filter handler.
|
||||
*/
|
||||
public function testBooleanFilterHandler() {
|
||||
// Create a boolean field.
|
||||
$field_name = 'field_boolean';
|
||||
$field_storage = FieldStorageConfig::create([
|
||||
'field_name' => $field_name,
|
||||
'entity_type' => 'node',
|
||||
'type' => 'boolean',
|
||||
]);
|
||||
$field_storage->save();
|
||||
$field = FieldConfig::create([
|
||||
'field_storage' => $field_storage,
|
||||
'bundle' => 'page',
|
||||
]);
|
||||
$field->save();
|
||||
|
||||
$url = "admin/structure/views/nojs/add-handler/test_view_fieldapi/default/filter";
|
||||
$this->drupalPostForm($url, ['name[node__' . $field_name . '.' . $field_name . '_value]' => TRUE], t('Add and configure @handler', array('@handler' => t('filter criteria'))));
|
||||
$this->assertResponse(200);
|
||||
// Verify that using a boolean field as a filter also results in using the
|
||||
// boolean plugin.
|
||||
$option = $this->xpath('//label[@for="edit-options-value-1"]');
|
||||
$this->assertEqual(t('True'), (string) $option[0]);
|
||||
$option = $this->xpath('//label[@for="edit-options-value-0"]');
|
||||
$this->assertEqual(t('False'), (string) $option[0]);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue