Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0

This commit is contained in:
Pantheon Automation 2016-10-06 15:16:20 -07:00 committed by Greg Anderson
parent 2f563ab520
commit f1c8716f57
1732 changed files with 52334 additions and 11780 deletions

View file

@ -55,7 +55,7 @@ class BooleanItemTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertTrue($entity->field_boolean instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->field_boolean[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->field_boolean->value, $value);
@ -68,7 +68,7 @@ class BooleanItemTest extends FieldKernelTestBase {
// Read changed entity and assert changed values.
$entity->save();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->field_boolean->value, $new_value);
// Test sample item generation.

View file

@ -137,7 +137,8 @@ class BulkDeleteTest extends FieldKernelTestBase {
$entity->save();
}
}
$this->entities = entity_load_multiple($this->entityTypeId);
$this->entities = $this->container->get('entity_type.manager')
->getStorage($this->entityTypeId)->loadMultiple();
foreach ($this->entities as $entity) {
// This test relies on the entities having stale field definitions
// so that the deleted field can be accessed on them. Access the field

View file

@ -52,7 +52,7 @@ class EmailItemTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertTrue($entity->field_email instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->field_email[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->field_email->value, $value);
@ -65,7 +65,7 @@ class EmailItemTest extends FieldKernelTestBase {
// Read changed entity and assert changed values.
$entity->save();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->field_email->value, $new_value);
// Test sample item generation.

View file

@ -116,7 +116,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
$entity->name->value = $this->randomMachineName();
$entity->save();
$entity = entity_load('entity_test', $entity->id());
$entity = EntityTest::load($entity->id());
$this->assertTrue($entity->field_test_taxonomy_term instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->field_test_taxonomy_term[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->field_test_taxonomy_term->target_id, $tid);
@ -212,7 +212,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
$entity->name->value = $this->randomMachineName();
$entity->save();
$entity = entity_load('entity_test', $entity->id());
$entity = EntityTest::load($entity->id());
$this->assertTrue($entity->field_test_taxonomy_vocabulary instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->field_test_taxonomy_vocabulary[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->field_test_taxonomy_vocabulary->target_id, $referenced_entity_id);

View file

@ -70,7 +70,7 @@ class FieldImportDeleteUninstallTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->field_test->value, $value);
$this->assertEqual($entity->field_test[0]->value, $value);
$this->assertEqual($entity->field_int->value, '99');
@ -134,7 +134,7 @@ class FieldImportDeleteUninstallTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->field_test->value, $value);
}

View file

@ -186,8 +186,11 @@ abstract class FieldKernelTestBase extends KernelTestBase {
*/
protected function assertFieldValues(EntityInterface $entity, $field_name, $expected_values, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, $column = 'value') {
// Re-load the entity to make sure we have the latest changes.
\Drupal::entityManager()->getStorage($entity->getEntityTypeId())->resetCache(array($entity->id()));
$e = entity_load($entity->getEntityTypeId(), $entity->id());
$storage = $this->container->get('entity_type.manager')
->getStorage($entity->getEntityTypeId());
$storage->resetCache([$entity->id()]);
$e = $storage->load($this->entityId);
$field = $values = $e->getTranslation($langcode)->$field_name;
// Filter out empty values so that they don't mess with the assertions.
$field->filterEmptyItems();

View file

@ -61,7 +61,7 @@ class NumberItemTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertTrue($entity->field_integer instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->field_integer[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->field_integer->value, $integer);
@ -88,7 +88,7 @@ class NumberItemTest extends FieldKernelTestBase {
// Read changed entity and assert changed values.
$entity->save();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->field_integer->value, $new_integer);
$this->assertEqual($entity->field_float->value, $new_float);
$this->assertEqual($entity->field_decimal->value, $new_decimal);

View file

@ -60,7 +60,7 @@ class ShapeItemTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertTrue($entity->{$this->fieldName} instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->{$this->fieldName}[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->{$this->fieldName}->shape, $shape);
@ -78,7 +78,7 @@ class ShapeItemTest extends FieldKernelTestBase {
// Read changed entity and assert changed values.
$entity->save();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->{$this->fieldName}->shape, $new_shape);
$this->assertEqual($entity->{$this->fieldName}->color, $new_color);
}

View file

@ -59,7 +59,7 @@ class TestItemTest extends FieldKernelTestBase {
// Verify entity has been created properly.
$id = $entity->id();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertTrue($entity->{$this->fieldName} instanceof FieldItemListInterface, 'Field implements interface.');
$this->assertTrue($entity->{$this->fieldName}[0] instanceof FieldItemInterface, 'Field item implements interface.');
$this->assertEqual($entity->{$this->fieldName}->value, $value);
@ -72,7 +72,7 @@ class TestItemTest extends FieldKernelTestBase {
// Read changed entity and assert changed values.
$entity->save();
$entity = entity_load('entity_test', $id);
$entity = EntityTest::load($id);
$this->assertEqual($entity->{$this->fieldName}->value, $new_value);
// Test the schema for this field type.