namespace Drupal\Tests\field_ui\Kernel;
use Drupal\Component\Render\FormattableMarkup;
-use Drupal\Component\Utility\Unicode;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Database;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
'link_to_entity' => FALSE,
],
'third_party_settings' => [],
- 'region' => 'content'
+ 'region' => 'content',
];
$this->assertEqual($display->getComponents(), $expected);
$display->save();
$components = array_keys($display->getComponents());
// The name field is not configurable so will be added automatically.
- $expected = [ 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
+ $expected = [0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
$this->assertIdentical($components, $expected);
}
$display = entity_get_display('entity_test', 'entity_test', 'default');
$this->assertFalse($display->isNew());
$this->assertEqual($display->id(), 'entity_test.entity_test.default');
- $this->assertEqual($display->getComponent('component_1'), [ 'weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
+ $this->assertEqual($display->getComponent('component_1'), ['weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
}
/**
// Check that the default visibility taken into account for extra fields
// unknown in the display.
- $this->assertEqual($display->getComponent('display_extra_field'), ['weight' => 5, 'region' => 'content']);
+ $this->assertEqual(
+ $display->getComponent('display_extra_field'),
+ [
+ 'weight' => 5,
+ 'region' => 'content',
+ 'settings' => [],
+ 'third_party_settings' => [],
+ ]
+ );
$this->assertNull($display->getComponent('display_extra_field_hidden'));
// Check that setting explicit options overrides the defaults.
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',
- 'type' => 'test_field'
+ 'type' => 'test_field',
]);
$field_storage->save();
$field = FieldConfig::create([
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',
- 'type' => 'test_field'
+ 'type' => 'test_field',
]);
$field_storage->save();
$field = FieldConfig::create([
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',
- 'type' => 'text'
+ 'type' => 'text',
]);
$field_storage->save();
$field = FieldConfig::create([
// Create two arbitrary user roles.
for ($i = 0; $i < 2; $i++) {
$roles[$i] = Role::create([
- 'id' => Unicode::strtolower($this->randomMachineName()),
+ 'id' => mb_strtolower($this->randomMachineName()),
'label' => $this->randomString(),
]);
$roles[$i]->save();
}
// Create a field of type 'test_field' attached to 'entity_test'.
- $field_name = Unicode::strtolower($this->randomMachineName());
+ $field_name = mb_strtolower($this->randomMachineName());
FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',