Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldFormatter\TextDefaultFormatter.
*/
namespace Drupal\text\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldFormatter\TextSummaryOrTrimmedFormatter.
*/
namespace Drupal\text\Plugin\Field\FieldFormatter;
/**

View file

@ -1,9 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldFormatter\TextTrimmedFormatter.
*/
namespace Drupal\text\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldType\TextItem.
*/
namespace Drupal\text\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldType\TextItemBase.
*/
namespace Drupal\text\Plugin\Field\FieldType;
use Drupal\Component\Utility\Random;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldType\TextLongItem.
*/
namespace Drupal\text\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldType\TextWithSummaryItem.
*/
namespace Drupal\text\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldWidget\TextareaWidget.
*/
namespace Drupal\text\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget.
*/
namespace Drupal\text\Plugin\Field\FieldWidget;
use Drupal\Core\Form\FormStateInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\Field\FieldWidget\TextfieldWidget.
*/
namespace Drupal\text\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;

View file

@ -1,13 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\text\Plugin\migrate\cckfield\TextField.
*/
namespace Drupal\text\Plugin\migrate\cckfield;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;

View file

@ -1,14 +1,11 @@
<?php
/**
* @file
* Contains \Drupal\text\Tests\Formatter\TextFormatterTest.
*/
namespace Drupal\text\Tests\Formatter;
use Drupal\field\Entity\FieldConfig;
use Drupal\filter\Entity\FilterFormat;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the text formatters functionality.
@ -44,7 +41,7 @@ class TextFormatterTest extends EntityUnitTestBase {
protected function setUp() {
parent::setUp();
entity_create('filter_format', array(
FilterFormat::create(array(
'format' => 'my_text_format',
'name' => 'My text format',
'filters' => array(
@ -55,18 +52,18 @@ class TextFormatterTest extends EntityUnitTestBase {
),
))->save();
entity_create('field_storage_config', array(
FieldStorageConfig::create(array(
'field_name' => 'formatted_text',
'entity_type' => $this->entityType,
'type' => 'text',
'settings' => array(),
))->save();
entity_create('field_config', array(
FieldConfig::create([
'entity_type' => $this->entityType,
'bundle' => $this->bundle,
'field_name' => 'formatted_text',
'label' => 'Filtered text',
))->save();
])->save();
}
/**
@ -80,7 +77,9 @@ class TextFormatterTest extends EntityUnitTestBase {
);
// Create the entity to be referenced.
$entity = entity_create($this->entityType, array('name' => $this->randomMachineName()));
$entity = $this->container->get('entity_type.manager')
->getStorage($this->entityType)
->create(array('name' => $this->randomMachineName()));
$entity->formatted_text = array(
'value' => 'Hello, world!',
'format' => 'my_text_format',

View file

@ -1,14 +1,12 @@
<?php
/**
* @file
* Contains \Drupal\text\Tests\TextFieldTest.
*/
namespace Drupal\text\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Tests\String\StringFieldTest;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the creation of text fields.
@ -39,7 +37,7 @@ class TextFieldTest extends StringFieldTest {
// Create a field with settings to validate.
$max_length = 3;
$field_name = Unicode::strtolower($this->randomMachineName());
$field_storage = entity_create('field_storage_config', array(
$field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'text',
@ -48,13 +46,13 @@ class TextFieldTest extends StringFieldTest {
)
));
$field_storage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
))->save();
])->save();
// Test validation with valid and invalid values.
$entity = entity_create('entity_test');
$entity = EntityTest::create();
for ($i = 0; $i <= $max_length + 2; $i++) {
$entity->{$field_name}->value = str_repeat('x', $i);
$violations = $entity->{$field_name}->validate();
@ -73,32 +71,32 @@ class TextFieldTest extends StringFieldTest {
function testRequiredLongTextWithFileUpload() {
// Create a text field.
$text_field_name = 'text_long';
$field_storage = entity_create('field_storage_config', array(
$field_storage = FieldStorageConfig::create(array(
'field_name' => $text_field_name,
'entity_type' => 'entity_test',
'type' => 'text_with_summary',
));
$field_storage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
'label' => $this->randomMachineName() . '_label',
'required' => TRUE,
))->save();
])->save();
// Create a file field.
$file_field_name = 'file_field';
$field_storage = entity_create('field_storage_config', array(
$field_storage = FieldStorageConfig::create(array(
'field_name' => $file_field_name,
'entity_type' => 'entity_test',
'type' => 'file'
));
$field_storage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
'label' => $this->randomMachineName() . '_label',
))->save();
])->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($text_field_name, array(
@ -151,17 +149,17 @@ class TextFieldTest extends StringFieldTest {
// Create a field.
$field_name = Unicode::strtolower($this->randomMachineName());
$field_storage = entity_create('field_storage_config', array(
$field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => $field_type
));
$field_storage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
'label' => $this->randomMachineName() . '_label',
))->save();
])->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($field_name, array(
'type' => $widget_type,

View file

@ -1,13 +1,9 @@
<?php
/**
* @file
* Contains \Drupal\text\Tests\TextSummaryTest.
*/
namespace Drupal\text\Tests;
use Drupal\simpletest\KernelTestBase;
use Drupal\filter\Entity\FilterFormat;
/**
* Tests text_summary() with different strings and lengths.
@ -21,7 +17,6 @@ class TextSummaryTest extends KernelTestBase {
protected function setUp() {
parent::setUp();
$this->installSchema('system', 'url_alias');
$this->installConfig(array('text'));
}
@ -55,7 +50,7 @@ class TextSummaryTest extends KernelTestBase {
* Test various summary length edge cases.
*/
function testLength() {
entity_create('filter_format', array(
FilterFormat::create(array(
'format' => 'autop',
'filters' => array(
'filter_autop' => array(
@ -63,7 +58,7 @@ class TextSummaryTest extends KernelTestBase {
),
),
))->save();
entity_create('filter_format', array(
FilterFormat::create(array(
'format' => 'autop_correct',
'filters' => array(
'filter_autop' => array(

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\text\TextProcessed.
*/
namespace Drupal\text;
use Drupal\Core\TypedData\DataDefinitionInterface;

View file

@ -1,14 +1,9 @@
<?php
/**
* @file
* Contains \Drupal\text\Tests\Migrate\MigrateTextConfigsTest.
*/
namespace Drupal\text\Tests\Migrate;
namespace Drupal\Tests\text\Kernel\Migrate;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to text.settings.yml.

View file

@ -1,22 +1,20 @@
<?php
/**
* @file
* Contains \Drupal\text\Tests\TextWithSummaryItemTest.
*/
namespace Drupal\text\Tests;
namespace Drupal\Tests\text\Kernel;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
use Drupal\field\Entity\FieldConfig;
use Drupal\Tests\field\Kernel\FieldKernelTestBase;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\filter\Entity\FilterFormat;
/**
* Tests using entity fields of the text summary field type.
*
* @group text
*/
class TextWithSummaryItemTest extends FieldUnitTestBase {
class TextWithSummaryItemTest extends FieldKernelTestBase {
/**
* Modules to enable.
@ -47,7 +45,7 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
// Create the necessary formats.
$this->installConfig(array('filter'));
entity_create('filter_format', array(
FilterFormat::create(array(
'format' => 'no_filters',
'filters' => array(),
))->save();
@ -61,7 +59,9 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
$this->createField($entity_type);
// Create an entity with a summary and no text format.
$entity = entity_create($entity_type);
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
->create();
$entity->summary_field->value = $value = $this->randomMachineName();
$entity->summary_field->summary = $summary = $this->randomMachineName();
$entity->summary_field->format = NULL;
@ -85,7 +85,9 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
$this->assertEqual($entity->summary_field->summary_processed, $summary);
// Test the generateSampleValue() method.
$entity = entity_create($entity_type);
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
->create();
$entity->summary_field->generateSampleItems();
$this->entityValidateAndSave($entity);
}
@ -98,7 +100,7 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
*/
protected function createField($entity_type) {
// Create a field .
$this->fieldStorage = entity_create('field_storage_config', array(
$this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => 'summary_field',
'entity_type' => $entity_type,
'type' => 'text_with_summary',
@ -107,10 +109,10 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
)
));
$this->fieldStorage->save();
$this->field = entity_create('field_config', array(
$this->field = FieldConfig::create([
'field_storage' => $this->fieldStorage,
'bundle' => $entity_type,
));
]);
$this->field->save();
}

View file

@ -1,13 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\Tests\text\Unit\Migrate\TextFieldTest.
*/
namespace Drupal\Tests\text\Unit\Migrate;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Row;
use Drupal\Tests\UnitTestCase;
use Drupal\text\Plugin\migrate\cckfield\TextField;
@ -25,7 +20,7 @@ class TextFieldTest extends UnitTestCase {
protected $plugin;
/**
* @var \Drupal\migrate\Entity\MigrationInterface
* @var \Drupal\migrate\Plugin\MigrationInterface
*/
protected $migration;

View file

@ -3,7 +3,7 @@
* Text behaviors.
*/
(function ($) {
(function ($, Drupal) {
'use strict';
@ -58,4 +58,4 @@
}
};
})(jQuery);
})(jQuery, Drupal);