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\telephone\Plugin\Field\FieldFormatter\TelephoneLinkFormatter.
*/
namespace Drupal\telephone\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;

View file

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

View file

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

View file

@ -1,13 +1,10 @@
<?php
/**
* @file
* Contains \Drupal\telephone\Tests\TelephoneFieldTest.
*/
namespace Drupal\telephone\Tests;
use Drupal\field\Entity\FieldConfig;
use Drupal\simpletest\WebTestBase;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the creation of telephone fields.
@ -50,17 +47,17 @@ class TelephoneFieldTest extends WebTestBase {
function testTelephoneField() {
// Add the telephone field to the article content type.
entity_create('field_storage_config', array(
FieldStorageConfig::create(array(
'field_name' => 'field_telephone',
'entity_type' => 'node',
'type' => 'telephone',
))->save();
entity_create('field_config', array(
FieldConfig::create([
'field_name' => 'field_telephone',
'label' => 'Telephone Number',
'entity_type' => 'node',
'bundle' => 'article',
))->save();
])->save();
entity_get_form_display('node', 'article', 'default')
->setComponent('field_telephone', array(

View file

@ -1,22 +1,20 @@
<?php
/**
* @file
* Contains \Drupal\telephone\Tests\TelephoneItemTest.
*/
namespace Drupal\telephone\Tests;
namespace Drupal\Tests\telephone\Kernel;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\Tests\field\Kernel\FieldKernelTestBase;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the telephone field type.
*
* @group telephone
*/
class TelephoneItemTest extends FieldUnitTestBase {
class TelephoneItemTest extends FieldKernelTestBase {
/**
* Modules to enable.
@ -29,16 +27,16 @@ class TelephoneItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a telephone field storage and field for validation.
entity_create('field_storage_config', array(
FieldStorageConfig::create(array(
'field_name' => 'field_test',
'entity_type' => 'entity_test',
'type' => 'telephone',
))->save();
entity_create('field_config', array(
FieldConfig::create([
'entity_type' => 'entity_test',
'field_name' => 'field_test',
'bundle' => 'entity_test',
))->save();
])->save();
}
/**
@ -46,7 +44,7 @@ class TelephoneItemTest extends FieldUnitTestBase {
*/
public function testTestItem() {
// Verify entity creation.
$entity = entity_create('entity_test');
$entity = EntityTest::create();
$value = '+0123456789';
$entity->field_test = $value;
$entity->name->value = $this->randomMachineName();
@ -71,7 +69,7 @@ class TelephoneItemTest extends FieldUnitTestBase {
$this->assertEqual($entity->field_test->value, $new_value);
// Test sample item generation.
$entity = entity_create('entity_test');
$entity = EntityTest::create();
$entity->field_test->generateSampleItems();
$this->entityValidateAndSave($entity);
}