Commit 2c03b9f0 authored by alexpott's avatar alexpott

Issue #2572789 by attiks, andriyun: Fix 'Drupal.WhiteSpace.Comma' coding standard

parent a2f20694
......@@ -1782,7 +1782,7 @@ function drupal_common_theme() {
'render element' => 'page',
),
'maintenance_task_list' => array(
'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
),
'authorize_report' => array(
'variables' => ['messages' => [], 'attributes' => []],
......
......@@ -14,7 +14,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
use ContainerAwareTrait;
......
......@@ -61,7 +61,7 @@ public static function create($string) {
* A list of allowed tags.
*/
public static function allowedTags() {
return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
}
/**
......
......@@ -30,7 +30,7 @@ public function connect() {
* {@inheritdoc}
*/
protected function copyFileJailed($source, $destination) {
if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
throw new FileTransferException("Cannot move @source to @destination", NULL, array("@source" => $source, "@destination" => $destination));
}
}
......
......@@ -267,7 +267,7 @@ public function getActiveTheme(Extension $theme, array $base_themes = []) {
*/
protected function getExtensions() {
if (!isset($this->extensions)) {
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
}
return $this->extensions;
}
......
......@@ -260,7 +260,7 @@ public function getDefaultConstraints(DataDefinitionInterface $definition) {
$constraints['NotNull'] = array();
}
// Check if the class provides allowed values.
if (is_subclass_of($definition->getClass(),'Drupal\Core\TypedData\OptionsProviderInterface')) {
if (is_subclass_of($definition->getClass(), 'Drupal\Core\TypedData\OptionsProviderInterface')) {
$constraints['AllowedValues'] = array();
}
return $constraints;
......
......@@ -52,7 +52,7 @@ public static function decodeException($exception) {
// The first element in the stack is the call, the second element gives us
// the caller. We skip calls that occurred in one of the classes of the
// database layer or in one of its global functions.
$db_functions = array('db_query', 'db_query_range');
$db_functions = array('db_query', 'db_query_range');
while (!empty($backtrace[1]) && ($caller = $backtrace[1]) &&
((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE || strpos($caller['class'], 'PDO') !== FALSE)) ||
in_array($caller['function'], $db_functions))) {
......
......@@ -265,7 +265,7 @@ public function testBlockRendering() {
$result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2');
$this->assertTrue(empty($result), 'The title is not visible.');
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' , 'rendered']));
}
/**
......@@ -291,7 +291,7 @@ public function testBlockEmptyRendering() {
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
// Ensure that the view cachability metadata is propagated even, for an
// empty block.
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add a header displayed on empty result.
......@@ -309,7 +309,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Hide the header on empty results.
......@@ -327,7 +327,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add an empty text.
......@@ -344,7 +344,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
}
......
......@@ -24,7 +24,7 @@ class RevisionRelationshipsTest extends ViewTestBase {
*
* @var array
*/
public static $modules = array('block_content' ,'block_content_test_views');
public static $modules = array('block_content' , 'block_content_test_views');
/**
* Views used by this test.
......
......@@ -129,7 +129,7 @@ public function testCommentPreviewDuplicateSubmission() {
* Tests comment edit, preview, and save.
*/
function testCommentEditPreviewSave() {
$web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval', 'edit own comments'));
$web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval', 'edit own comments'));
$this->drupalLogin($this->adminUser);
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
......
......@@ -47,7 +47,7 @@ public function testLinkApprove() {
$view = Views::getView('test_comment');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
$view->displayHandlers->get('default')->overrideOption('fields', [
'approve_comment' => [
'table' => 'comment',
'field' => 'approve_comment',
......@@ -134,7 +134,7 @@ public function testLinkReply() {
$view = Views::getView('test_comment');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
$view->displayHandlers->get('default')->overrideOption('fields', [
'replyto_comment' => [
'table' => 'comment',
'field' => 'replyto_comment',
......
......@@ -92,7 +92,7 @@ function testDiff() {
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, $config_name);
// Prove the fields match.
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual(count($edits), 1, 'There is one item in the diff');
// Rename the entity.
......@@ -102,11 +102,11 @@ function testDiff() {
$diff = \Drupal::service('config.manager')->diff($active, $sync, 'config_test.dynamic.' . $new_test_entity_id, $config_name);
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'change', 'The second item in the diff is a change.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'change', 'The second item in the diff is a change.');
$this->assertEqual($edits[1]->orig, array('id: ' . $new_test_entity_id));
$this->assertEqual($edits[1]->closing, array('id: ' . $test_entity_id));
$this->assertEqual($edits[2]->type, 'copy', 'The third item in the diff is a copy.');
$this->assertEqual($edits[2]->type, 'copy', 'The third item in the diff is a copy.');
$this->assertEqual(count($edits), 3, 'There are three items in the diff.');
}
......@@ -132,16 +132,16 @@ function testCollectionDiff() {
// Test the fields match in the default collection diff.
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual(count($edits), 1, 'There is one item in the diff');
// Test that the differences are detected when diffing the collection.
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, NULL, 'test');
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.');
$this->assertEqual($edits[0]->orig, array('foo: bar'));
$this->assertEqual($edits[0]->closing, array('foo: baz'));
$this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.');
}
}
......@@ -87,7 +87,7 @@ function testInstallProfileConfigOverwrite() {
// type does not exist.
$optional_dir = drupal_get_path('module', 'testing_config_overrides') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
$optional_storage = new FileStorage($optional_dir);
foreach (['config_test.dynamic.dotted.default', 'config_test.dynamic.override','config_test.dynamic.override_unmet'] as $id) {
foreach (['config_test.dynamic.dotted.default', 'config_test.dynamic.override', 'config_test.dynamic.override_unmet'] as $id) {
$this->assertTrue(\Drupal::config($id)->isNew(), "The config_test entity $id contained in the profile's optional directory does not exist.");
// Make that we don't get false positives from the assertion above.
$this->assertTrue($optional_storage->exists($id), "The config_test entity $id does exist in the profile's optional directory.");
......
......@@ -22,7 +22,7 @@ class ConfigLanguageOverrideTest extends KernelTestBase {
*
* @var array
*/
public static $modules = array('user', 'language', 'config_test', 'system', 'field');
public static $modules = array('user', 'language', 'config_test', 'system', 'field');
/**
* {@inheritdoc}
......
......@@ -30,7 +30,7 @@ class ContactCategoryTest extends MigrateSqlSourceTestCase {
array(
'cid' => 1,
'category' => 'contact category value 1',
'recipients' => array('admin@example.com','user@example.com'),
'recipients' => array('admin@example.com', 'user@example.com'),
'reply' => 'auto reply value 1',
'weight' => 0,
'selected' => 0,
......@@ -38,7 +38,7 @@ class ContactCategoryTest extends MigrateSqlSourceTestCase {
array(
'cid' => 2,
'category' => 'contact category value 2',
'recipients' => array('admin@example.com','user@example.com'),
'recipients' => array('admin@example.com', 'user@example.com'),
'reply' => 'auto reply value 2',
'weight' => 0,
'selected' => 0,
......
......@@ -78,7 +78,7 @@ function hook_field_storage_config_update_forbid(\Drupal\field\FieldStorageConfi
// Forbid any update that removes allowed values with actual data.
$allowed_values = $field_storage->getSetting('allowed_values');
$prior_allowed_values = $prior_field_storage->getSetting('allowed_values');
$lost_keys = array_keys(array_diff_key($prior_allowed_values,$allowed_values));
$lost_keys = array_keys(array_diff_key($prior_allowed_values, $allowed_values));
if (_options_values_in_use($field_storage->getTargetEntityTypeId(), $field_storage->getName(), $lost_keys)) {
throw new \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName())));
}
......
......@@ -34,7 +34,7 @@ public function query() {
'type',
'module',
))
->condition('fci.entity_type','node');
->condition('fci.entity_type', 'node');
$query->join('field_config', 'fc', 'fci.field_id = fc.id');
return $query;
}
......
......@@ -62,7 +62,7 @@ protected function setUp() {
$this->installEntitySchema('entity_test_mul');
// Create reference from entity_test to entity_test_mul.
$this->createEntityReferenceField('entity_test','entity_test','field_test_data','field_test_data','entity_test_mul');
$this->createEntityReferenceField('entity_test', 'entity_test', 'field_test_data', 'field_test_data', 'entity_test_mul');
// Create reference from entity_test_mul to entity_test.
$this->createEntityReferenceField('entity_test_mul', 'entity_test_mul', 'field_data_test', 'field_data_test', 'entity_test');
......
......@@ -80,8 +80,8 @@ public function testEntityCountAndHasData() {
// Create 12 entities to ensure that the purging works as expected.
for ($i=0; $i < 12; $i++) {
$entity = entity_create('entity_test');
$entity->field_int[] = mt_rand(1,99);
$entity->field_int[] = mt_rand(1,99);
$entity->field_int[] = mt_rand(1, 99);
$entity->field_int[] = mt_rand(1, 99);
$entity->name[] = $this->randomMachineName();
$entity->save();
}
......
......@@ -39,22 +39,22 @@ public function testFields() {
// Integer field.
$field_storage = FieldStorageConfig::load('node.field_test_two');
$this->assertIdentical("integer", $field_storage->getType(), t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("integer", $field_storage->getType(), t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->getType())));
// Float field.
$field_storage = FieldStorageConfig::load('node.field_test_three');
$this->assertIdentical("decimal", $field_storage->getType(), t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("decimal", $field_storage->getType(), t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->getType())));
// Link field.
$field_storage = FieldStorageConfig::load('node.field_test_link');
$this->assertIdentical("link", $field_storage->getType(), t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("link", $field_storage->getType(), t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->getType())));
// File field.
$field_storage = FieldStorageConfig::load('node.field_test_filefield');
$this->assertIdentical("file", $field_storage->getType(), t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("file", $field_storage->getType(), t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->getType())));
$field_storage = FieldStorageConfig::load('node.field_test_imagefield');
$this->assertIdentical("image", $field_storage->getType(), t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("image", $field_storage->getType(), t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->getType())));
$settings = $field_storage->getSettings();
$this->assertIdentical('file', $settings['target_type']);
$this->assertIdentical('public', $settings['uri_scheme']);
......@@ -62,15 +62,15 @@ public function testFields() {
// Phone field.
$field_storage = FieldStorageConfig::load('node.field_test_phone');
$this->assertIdentical("telephone", $field_storage->getType(), t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("telephone", $field_storage->getType(), t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->getType())));
// Date field.
$field_storage = FieldStorageConfig::load('node.field_test_datetime');
$this->assertIdentical("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType())));
// Decimal field with radio buttons.
$field_storage = FieldStorageConfig::load('node.field_test_decimal_radio_buttons');
$this->assertIdentical("list_float", $field_storage->getType(), t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("list_float", $field_storage->getType(), t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->getType())));
$this->assertNotNull($field_storage->getSetting('allowed_values')['1.2'], t('First allowed value key is set to 1.2'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['2.1'], t('Second allowed value key is set to 2.1'));
$this->assertIdentical('1.2', $field_storage->getSetting('allowed_values')['1.2'], t('First allowed value is set to 1.2'));
......@@ -78,11 +78,11 @@ public function testFields() {
// Float field with a single checkbox.
$field_storage = FieldStorageConfig::load('node.field_test_float_single_checkbox');
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
// Integer field with a select list.
$field_storage = FieldStorageConfig::load('node.field_test_integer_selectlist');
$this->assertIdentical("list_integer", $field_storage->getType(), t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("list_integer", $field_storage->getType(), t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertNotNull($field_storage->getSetting('allowed_values')['1234'], t('First allowed value key is set to 1234'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['2341'], t('Second allowed value key is set to 2341'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['3412'], t('Third allowed value key is set to 3412'));
......@@ -94,7 +94,7 @@ public function testFields() {
// Text field with a single checkbox.
$field_storage = FieldStorageConfig::load('node.field_test_text_single_checkbox');
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
// Validate that the source count and processed count match up.
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
......
......@@ -371,8 +371,8 @@ function testNumberFormatter() {
$decimal_separators = array('.', ',');
$prefix = $this->randomMachineName();
$suffix = $this->randomMachineName();
$random_float = rand(0,pow(10,6));
$random_integer = rand(0, pow(10,6));
$random_float = rand(0, pow(10, 6));
$random_integer = rand(0, pow(10, 6));
// Create a content type containing float and integer fields.
$this->drupalCreateContentType(array('type' => $type));
......
......@@ -145,7 +145,7 @@ protected function testTimestampFormatter() {
protected function testTimestampAgoFormatter() {
$data = [];
foreach (array(1,2,3,4,5,6) as $granularity) {
foreach (array(1, 2, 3, 4, 5, 6) as $granularity) {
$data[] = [
'future_format' => '@interval hence',
'past_format' => '@interval ago',
......
......@@ -124,7 +124,7 @@ function field_test_field_widget_form_alter(&$element, FormStateInterface $form_
function field_test_query_efq_table_prefixing_test_alter(&$query) {
// Add an additional join onto the entity base table. This will cause an
// exception if the EFQ does not properly prefix the base table.
$query->join('entity_test','et2','%alias.id = entity_test.id');
$query->join('entity_test', 'et2', '%alias.id = entity_test.id');
}
......
......@@ -38,7 +38,7 @@ function field_ui_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('Configuring view and form modes') . '</dt>';
$output .= '<dd>' . t('You can add, edit, and delete view modes for entities on the <a href=":view_modes">View modes page</a>, and you can add, edit, and delete form modes for entities on the <a href=":form_modes">Form modes page</a>. Once you have defined a view mode or form mode for an entity type, it will be available on the Manage display or Manage form display page for each sub-type of that entity.', array(':view_modes' => \Drupal::url('entity.entity_view_mode.collection'), ':form_modes' => \Drupal::url('entity.entity_form_mode.collection'))) . '</dd>';
$output .= '<dt>' . t('Listing fields') . '</dt>';
$output .= '<dd>' . t('There are two reports available that list the fields defined on your site. The <a href=":entity-list" title="Entities field list report">Entities</a> report lists all your fields, showing the field machine names, types, and the entity types or sub-types they are used on (each sub-type links to the Manage fields page). If the <a href=":views">Views</a> and <a href=":views-ui">Views UI</a> modules are enabled, the <a href=":views-list" title="Used in views field list report">Used in views</a> report lists each field that is used in a view, with a link to edit that view.', array(':entity-list' => \Drupal::url('entity.field_storage_config.collection'), ':views-list' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('views_ui.reports_fields') : '#', ':views' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array('name' => 'views')) : '#',':views-ui' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('help.page', array('name' => 'views_ui')) : '#')) . '</dd>';
$output .= '<dd>' . t('There are two reports available that list the fields defined on your site. The <a href=":entity-list" title="Entities field list report">Entities</a> report lists all your fields, showing the field machine names, types, and the entity types or sub-types they are used on (each sub-type links to the Manage fields page). If the <a href=":views">Views</a> and <a href=":views-ui">Views UI</a> modules are enabled, the <a href=":views-list" title="Used in views field list report">Used in views</a> report lists each field that is used in a view, with a link to edit that view.', array(':entity-list' => \Drupal::url('entity.field_storage_config.collection'), ':views-list' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('views_ui.reports_fields') : '#', ':views' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array('name' => 'views')) : '#', ':views-ui' => (\Drupal::moduleHandler()->moduleExists('views_ui')) ? \Drupal::url('help.page', array('name' => 'views_ui')) : '#')) . '</dd>';
$output .= '</dl>';
return $output;
......
......@@ -132,7 +132,7 @@ public function testEntityDisplayCRUDSort() {
$display->save();
$components = array_keys($display->getComponents());
// The name field is not configurable so will be added automatically.
$expected = array ( 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name');
$expected = array ( 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name');
$this->assertIdentical($components, $expected);
}
......
......@@ -46,7 +46,7 @@ public function fieldUIAddNewField($bundle_path, $field_name, $label = NULL, $fi
}
// First step: 'Add field' page.
$this->drupalPostForm($bundle_path, $initial_edit, t('Save and continue'));
$this->drupalPostForm($bundle_path, $initial_edit, t('Save and continue'));
$this->assertRaw(t('These settings apply to the %label field everywhere it is used.', array('%label' => $label)), 'Storage settings page was displayed.');
// Test Breadcrumbs.
$this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
......
......@@ -492,13 +492,13 @@ function testDisallowedFieldNames() {
// Try with an entity key.
$edit['field_name'] = 'title';
$bundle_path = 'admin/structure/types/manage/' . $this->contentType;
$this->drupalPostForm("$bundle_path/fields/add-field", $edit, t('Save and continue'));
$this->drupalPostForm("$bundle_path/fields/add-field", $edit, t('Save and continue'));
$this->assertText(t('The machine-readable name is already in use. It must be unique.'));
// Try with a base field.
$edit['field_name'] = 'sticky';
$bundle_path = 'admin/structure/types/manage/' . $this->contentType;
$this->drupalPostForm("$bundle_path/fields/add-field", $edit, t('Save and continue'));
$this->drupalPostForm("$bundle_path/fields/add-field", $edit, t('Save and continue'));
$this->assertText(t('The machine-readable name is already in use. It must be unique.'));
}
......
......@@ -47,7 +47,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($plugin_id, $plugin_definition,$configuration['field_definition'], $configuration['settings'], $configuration['third_party_settings'], $container->get('element_info'));
return new static($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['third_party_settings'], $container->get('element_info'));
}
/**
......
......@@ -151,7 +151,7 @@ function testMultiValuedWidget() {
// - First remove the 2nd file.
// - Then remove what is then the 2nd file (was originally the 3rd file).
// - Then remove the first file.
foreach (array(1,1,0) as $delta) {
foreach (array(1, 1, 0) as $delta) {
// Ensure we have the expected number of Remove buttons, and that they
// are numbered sequentially.
$buttons = $this->xpath('//input[@type="submit" and @value="Remove"]');
......
......@@ -22,11 +22,11 @@ function filter_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.filter':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Filter module allows administrators to configure text formats. Text formats change how HTML tags and other text will be <em>processed and displayed</em> in the site. They are used to transform text, and also help to defend your web site against potentially damaging input from malicious users. Visual text editors can be associated with text formats by using the <a href=":editor_help">Text Editor module</a>. For more information, see the <a href=":filter_do">online documentation for the Filter module</a>.', array(':filter_do' => 'https://www.drupal.org/documentation/modules/filter/',':editor_help' => (\Drupal::moduleHandler()->moduleExists('editor')) ? \Drupal::url('help.page', array('name' => 'editor')) : '#')) . '</p>';
$output .= '<p>' . t('The Filter module allows administrators to configure text formats. Text formats change how HTML tags and other text will be <em>processed and displayed</em> in the site. They are used to transform text, and also help to defend your web site against potentially damaging input from malicious users. Visual text editors can be associated with text formats by using the <a href=":editor_help">Text Editor module</a>. For more information, see the <a href=":filter_do">online documentation for the Filter module</a>.', array(':filter_do' => 'https://www.drupal.org/documentation/modules/filter/', ':editor_help' => (\Drupal::moduleHandler()->moduleExists('editor')) ? \Drupal::url('help.page', array('name' => 'editor')) : '#')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Managing text formats') . '</dt>';
$output .= '<dd>' . t('You can create and edit text formats on the <a href=":formats">Text formats page</a> (if the Text Editor module is enabled, this page is named Text formats and editors). One text format is included by default: Plain text (which removes all HTML tags). Additional text formats may be created during installation. You can create a text format by clicking "<a href=":add_format">Add text format</a>".', array(':formats' => \Drupal::url('filter.admin_overview'),':add_format' => \Drupal::url('filter.format_add'))) . '</dd>';
$output .= '<dd>' . t('You can create and edit text formats on the <a href=":formats">Text formats page</a> (if the Text Editor module is enabled, this page is named Text formats and editors). One text format is included by default: Plain text (which removes all HTML tags). Additional text formats may be created during installation. You can create a text format by clicking "<a href=":add_format">Add text format</a>".', array(':formats' => \Drupal::url('filter.admin_overview'), ':add_format' => \Drupal::url('filter.format_add'))) . '</dd>';
$output .= '<dt>' . t('Assigning roles to text formats') . '</dt>';
$output .= '<dd>' . t('You can define which users will be able to use each text format by selecting roles. To ensure security, anonymous and untrusted users should only have access to text formats that restrict them to either plain text or a safe set of HTML tags. This is because HTML tags can allow embedding malicious links or scripts in text. More trusted registered users may be granted permission to use less restrictive text formats in order to create rich text. <strong>Improper text format configuration is a security risk.</strong>') . '</dd>';
$output .= '<dt>' . t('Selecting filters') . '</dt>';
......@@ -817,7 +817,7 @@ function filter_filter_secure_image_alter(&$image) {
$image->setAttribute('alt', t('Image removed.'));
$image->setAttribute('title', t('This image has been removed. For security reasons, only images from the local domain are allowed.'));
$image->setAttribute('height', '16');
$image->setAttribute('width', '16');
$image->setAttribute('width', '16');
// Add a CSS class to aid in styling.
$class = ($image->getAttribute('class') ? trim($image->getAttribute('class')) . ' ' : '');
......
......@@ -139,7 +139,7 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st
$path_info = pathinfo($image_uri);
$converted_image_uri = $path_info['dirname'] . DIRECTORY_SEPARATOR . $path_info['filename'];
if (!file_exists($converted_image_uri)) {
$this->logger->notice('Source image at %source_image_path not found while trying to generate derivative image at %derivative_path.', array('%source_image_path' => $image_uri, '%derivative_path' => $derivative_uri));
$this->logger->notice('Source image at %source_image_path not found while trying to generate derivative image at %derivative_path.', array('%source_image_path' => $image_uri, '%derivative_path' => $derivative_uri));
return new Response($this->t('Error generating image, missing source file.'), 404);
}
else {
......
......@@ -326,7 +326,7 @@ public function testInvalidDefaultImage() {
// The non-existent default image should not be saved.
$this->assertNull($settings['default_image']['uuid']);
$field = entity_create('field_config', array(
$field = entity_create('field_config', array(
'field_storage' => $field_storage,
'bundle' => 'page',
'label' => $this->randomMachineName(),
......
......@@ -136,7 +136,7 @@ function _testImageFieldFormatters($scheme) {
// Only verify HTTP headers when using private scheme and the headers are
// sent by Drupal.
$this->assertEqual($this->drupalGetHeader('Content-Type'), 'image/png', 'Content-Type header was sent.');
$this->assertTrue(strstr($this->drupalGetHeader('Cache-Control'),'private') !== FALSE, 'Cache-Control header was sent.');
$this->assertTrue(strstr($this->drupalGetHeader('Cache-Control'), 'private') !== FALSE, 'Cache-Control header was sent.');
// Log out and try to access the file.
$this->drupalLogout();
......
......@@ -72,7 +72,7 @@ function testRequiredAttributes() {
// Look for form-required for the alt text.
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-alt" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-alt"]');
$this->assertTrue(isset($elements[0]),'Required marker is shown for the required alt text.');
$this->assertTrue(isset($elements[0]), 'Required marker is shown for the required alt text.');
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-title" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-title"]');
......
......@@ -34,7 +34,7 @@ public function testMigration() {
// These settings are not recommended...
$this->assertTrue($config->get('allow_insecure_derivatives'));
$this->assertTrue($config->get('suppress_itok_output'));
$this->assertIdentical("core/modules/image/testsample.png",$config->get('preview_image'));
$this->assertIdentical("core/modules/image/testsample.png", $config->get('preview_image'));
}
}
......@@ -49,7 +49,7 @@ function language_help($route_name, RouteMatchInterface $route_match) {
$output .= '<ul><li>' . t('<em>URL</em> sets the interface language based on a path prefix or domain (for example specifying <em>de</em> for German would result in URLs like <em>example.com/de/contact</em>). The default language does not require a path prefix, but can have one assigned as well. If the language detection is done by domain name, a domain needs to be specified for each language.') . '</li>';
$output .= '<li>' . t('<em>Session</em> determines the interface language from a request or session parameter (for example <em>example.com?language=de</em> would set the interface language to German based on the use of <em>de</em> as the <em>language</em> parameter).') . '</li>';
$output .= '<li>' . t('<em>User</em> follows the language configuration set on the user\'s profile page.') . '</li>';
$output .= '<li>' . t('<em>Browser</em> sets the interface language based on the browser\'s language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the <a href=":language_list">language codes</a> used on your site.', array(':language_list' => \Drupal::url('entity.configurable_language.collection'))) . '</li>';
$output .= '<li>' . t('<em>Browser</em> sets the interface language based on the browser\'s language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the <a href=":language_list">language codes</a> used on your site.', array(':language_list' => \Drupal::url('entity.configurable_language.collection'))) . '</li>';
$output .= '<li>' . t('<em>Account administration pages</em> follows the configuration set as <em>Administration pages language</em> on the profile page of an administrative user. This method is similar to the <em>User</em> method, but only sets the interface text language on administration pages, independent of the interface text language on other pages.') . '</li>';
$output .= '<li>' . t('<em>Selected language</em> allows you to specify the site\'s default language or a specific language as the fall-back language. This method should be listed last.') . '</li></ul></dd>';
$output .= '</dl>';
......
......@@ -117,7 +117,7 @@ public function testDefaultLangcode() {
$this->assertTrue($configurable_language->isDefault(), 'The en language entity is flagged as the default language.');
$this->config('system.site')->set('default_langcode', 'cc')->save();
ContentLanguageSettings::loadByEntityTypeBundle('entity_test','custom_bundle')
ContentLanguageSettings::loadByEntityTypeBundle('entity_test', 'custom_bundle')
->setLanguageAlterable(TRUE)
->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT)
->save();
......
......@@ -33,7 +33,7 @@ protected function setUp() {
*/
public function testLocalePageLocalTasks($route) {
$tasks = array(
0 => array('locale.translate_page', 'locale.translate_import', 'locale.translate_export','locale.settings'),
0 => array('locale.translate_page', 'locale.translate_import', 'locale.translate_export', 'locale.settings'),
);
$this->assertLocalTasks($route, $tasks);
}
......
......@@ -270,7 +270,7 @@ function menu_ui_form_node_form_alter(&$form, FormStateInterface $form_state) {
else {
$default = $node_type->getThirdPartySetting('menu_ui', 'parent', 'main:');
}
$parent_element = $menu_parent_selector->parentSelectElement($default, $defaults['id'], $available_menus);
$parent_element = $menu_parent_selector->parentSelectElement($default, $defaults['id'], $available_menus);
// If no possible parent menu items were found, there is nothing to display.
if (empty($parent_element)) {
return;
......
......@@ -116,7 +116,7 @@ function testMenu() {
// Verify delete link exists and reset link does not exist.
$this->drupalGet('admin/structure/menu/manage/' . $this->menu->id());
$this->assertLinkByHref(Url::fromRoute('entity.menu_link_content.delete_form', ['menu_link_content' => $this->items[0]->id()])->toString());
$this->assertLinkByHref(Url::fromRoute('entity.menu_link_content.delete_form', ['menu_link_content' => $this->items[0]->id()])->toString());
$this->assertNoLinkByHref(Url::fromRoute('menu_ui.link_reset', ['menu_link_plugin' => $this->items[0]->getPluginId()])->toString());
// Check delete and reset access.
$this->drupalGet('admin/structure/menu/item/' . $this->items[0]->id() . '/delete');
......@@ -265,23 +265,23 @@ function doMenuTests() {
$menu_name = $this->menu->id();
// Test the 'Add link' local action.
$this->drupalGet(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
$this->drupalGet(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
$this->clickLink(t('Add link'));
$link_title = $this->randomString();
$this->drupalPostForm(NULL, array('link[0][uri]' => '/', 'title[0][value]' => $link_title), t('Save'));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Test the 'Edit' operation.
$this->clickLink(t('Edit'));
$this->assertFieldByName('title[0][value]', $link_title);
$link_title = $this->randomString();
$this->drupalPostForm(NULL, array('title[0][value]' => $link_title), t('Save'));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Test the 'Delete' operation.
$this->clickLink(t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the custom menu link %item?', array('%item' => $link_title)));
$this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
$this->assertUrl(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Add nodes to use as links for menu links.
$node1 = $this->drupalCreateNode(array('type' => 'article'));
......
......@@ -63,7 +63,7 @@ public function testGetVariantIdsWithVariants() {
->willReturn(['d6_node__page', 'd6_node__article']);
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_user']);
$this->assertSame(['d6_node__page', 'd6_node__article', 'd6_user'], $ids);
$this->assertSame(['d6_node__page', 'd6_node__article', 'd6_user'], $ids);
}
/**
......@@ -76,7 +76,7 @@ public function testGetVariantIdsNoVariants() {
->willReturn([]);
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_user']);
$this->assertSame(['d6_user'], $ids);
$this->assertSame(['d6_user'], $ids);
}
/**
......@@ -90,7 +90,7 @@ public function testGetVariantIdsNoVariantsOrStaticDependencies() {
->willReturn([]);
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_node_revision:*']);
$this->assertSame([], $ids);
$this->assertSame([], $ids);
}
}
......
......@@ -39,7 +39,7 @@ public function testViewLanguage() {
$node = $this->drupalCreateNode(array('langcode' => 'es'));
$this->drupalGet($node->urlInfo());
$this->assertText('Spanish','The language field is displayed properly.');
$this->assertText('Spanish', 'The language field is displayed properly.');
}