Commit d5d0d6ce authored by alexpott's avatar alexpott
Browse files

Issue #2572777 by andypost, alexpott, attiks, andriyun: Fix...

Issue #2572777 by andypost, alexpott, attiks, andriyun: Fix 'Squiz.Strings.ConcatenationSpacing' coding standard
parent e0c2d965
......@@ -35,7 +35,7 @@ function testImageDimensions() {
/** @var $style \Drupal\image\ImageStyleInterface */
$style = ImageStyle::create(array('name' => 'test', 'label' => 'Test'));
$style->save();
$generated_uri = 'public://styles/test/public/'. \Drupal::service('file_system')->basename($original_uri);
$generated_uri = 'public://styles/test/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$variables = array(
......@@ -248,7 +248,7 @@ function testImageDimensions() {
'#height' => 20,
];
// PNG original image. Should be resized to 100x100.
$generated_uri = 'public://styles/test_uri/public/'. \Drupal::service('file_system')->basename($original_uri);
$generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$this->assertEqual($this->getImageTag($variables), '<img src="' . $url . '" width="100" height="100" alt="" class="image-style-test-uri" />');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
......@@ -261,7 +261,7 @@ function testImageDimensions() {
// GIF original image. Should be resized to 50x50.
$file = $files[1];
$original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME);
$generated_uri = 'public://styles/test_uri/public/'. \Drupal::service('file_system')->basename($original_uri);
$generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$variables['#uri'] = $original_uri;
$this->assertEqual($this->getImageTag($variables), '<img src="' . $url . '" width="50" height="50" alt="" class="image-style-test-uri" />');
......
......@@ -175,7 +175,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
// make sure that access is denied.
$file_noaccess = array_shift($files);
$original_uri_noaccess = file_unmanaged_copy($file_noaccess->uri, $scheme . '://', FILE_EXISTS_RENAME);
$generated_uri_noaccess = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/'. drupal_basename($original_uri_noaccess);
$generated_uri_noaccess = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/' . drupal_basename($original_uri_noaccess);
$this->assertFalse(file_exists($generated_uri_noaccess), 'Generated file does not exist.');
$generate_url_noaccess = $this->style->buildUrl($original_uri_noaccess);
......
......@@ -61,7 +61,7 @@ function testLanguageList() {
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]));
$this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.');
$this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
$this->assertText(t($name), 'Test language added.');
$language = \Drupal::service('language_manager')->getLanguage($langcode);
......
......@@ -86,7 +86,7 @@ function testInfoAlterations() {
$test_type = 'test_language_type';
$interface_method_id = LanguageNegotiationUI::METHOD_ID;
$test_method_id = 'test_language_negotiation_method';
$form_field = $type . '[enabled]['. $interface_method_id .']';
$form_field = $type . '[enabled][' . $interface_method_id . ']';
$edit = array(
$form_field => TRUE,
$type . '[enabled][' . $test_method_id . ']' => TRUE,
......
......@@ -139,7 +139,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$reader->setOptions($content_options);
$languages = $this->languageManager->getLanguages();
$language_name = isset($languages[$language->getId()]) ? $languages[$language->getId()]->getName() : '';
$filename = $language->getId() .'.po';
$filename = $language->getId() . '.po';
}
else {
// Template required.
......
......@@ -229,10 +229,10 @@ function testMenuNodeFormWidget() {
));
$child_item->save();
// Edit the first node.
$this->drupalGet('node/'. $node->id() .'/edit');
$this->drupalGet('node/' . $node->id() . '/edit');
// Assert that it is not possible to set the parent of the first node to itself or the second node.
$this->assertNoOption('edit-menu-menu-parent', 'tools:'. $item->getPluginId());
$this->assertNoOption('edit-menu-menu-parent', 'tools:'. $child_item->getPluginId());
$this->assertNoOption('edit-menu-menu-parent', 'tools:' . $item->getPluginId());
$this->assertNoOption('edit-menu-menu-parent', 'tools:' . $child_item->getPluginId());
// Assert that unallowed Administration menu is not available in options.
$this->assertNoOption('edit-menu-menu-parent', 'admin:');
}
......
......@@ -571,7 +571,7 @@ public function testBlockContextualLinks() {
$id = 'block:block=' . $block->id() . ':langcode=en|menu:menu=' . $custom_menu->id() . ':langcode=en';
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
$this->assertRaw('<div data-contextual-id="'. $id . '"></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
$this->assertRaw('<div data-contextual-id="' . $id . '"></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
// Get server-rendered contextual links.
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
......
......@@ -44,7 +44,7 @@ public function testMachineNames() {
// - Uppercase -> lowercase,
// - Multiple consecutive underscore -> single underscore.
$human_name_ascii = 'foo2, the.bar;2*&the%baz!YEE____HaW ';
$human_name = $human_name_ascii .'áéő';
$human_name = $human_name_ascii . 'áéő';
$expected_result = 'foo2_the_bar_2_the_baz_yee_haw_aeo';
// Test for calling transliterate on mock object.
$this->transliteration
......
......@@ -56,7 +56,7 @@ function testNodeTitle() {
// Test <title> tag.
$this->drupalGet('node/' . $node->id());
$xpath = '//title';
$this->assertEqual(current($this->xpath($xpath)), $node->label() .' | Drupal', 'Page title is equal to node title.', 'Node');
$this->assertEqual(current($this->xpath($xpath)), $node->label() . ' | Drupal', 'Page title is equal to node title.', 'Node');
// Test breadcrumb in comment preview.
$this->drupalGet('comment/reply/node/' . $node->id() . '/comment');
......
......@@ -170,7 +170,7 @@ function node_test_entity_view_mode_alter(&$view_mode, EntityInterface $entity,
function node_test_node_insert(NodeInterface $node) {
// Set the node title to the node ID and save.
if ($node->getTitle() == 'new') {
$node->setTitle('Node '. $node->id());
$node->setTitle('Node ' . $node->id());
$node->setNewRevision(FALSE);
$node->save();
}
......
......@@ -128,7 +128,7 @@ protected function setUp() {
public function testAutocompleteQuickEdit() {
$this->drupalLogin($this->editorUser);
$quickedit_uri = 'quickedit/form/node/'. $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$quickedit_uri = 'quickedit/form/node/' . $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
$response = $this->drupalPost($quickedit_uri, 'application/vnd.drupal-ajax', $post);
$ajax_commands = Json::decode($response);
......@@ -159,7 +159,7 @@ public function testAutocompleteQuickEdit() {
// Load the form again, which should now get it back from
// PrivateTempStore.
$quickedit_uri = 'quickedit/form/node/'. $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$quickedit_uri = 'quickedit/form/node/' . $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
$response = $this->drupalPost($quickedit_uri, 'application/vnd.drupal-ajax', $post);
$ajax_commands = Json::decode($response);
......
......@@ -69,7 +69,7 @@ public function testPatchUpdate() {
$this->assertResponse(204);
$entity = entity_load($entity_type, $entity->id(), TRUE);
$this->assertNotNull($entity->field_test_text->value. 'Test field has not been deleted.');
$this->assertNotNull($entity->field_test_text->value . 'Test field has not been deleted.');
// Try to empty a field.
$normalized['field_test_text'] = array();
......
......@@ -120,7 +120,7 @@ function testSearchResultsComment() {
$edit_comment['comment_body[0][value]'] = '<h1>' . $comment_body . '</h1>';
$full_html_format_id = 'full_html';
$edit_comment['comment_body[0][format]'] = $full_html_format_id;
$this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $edit_comment, t('Save'));
$this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $edit_comment, t('Save'));
// Post a comment with an evil script tag in the comment subject and a
// script tag nearby a keyword in the comment body. Use the 'FULL HTML' text
......
......@@ -86,8 +86,8 @@ public function testUserAgentValidation() {
$this->drupalLogout();
$system_path = $base_url . '/' . drupal_get_path('module', 'system');
$HTTP_path = $system_path .'/tests/http.php/user/login';
$https_path = $system_path .'/tests/https.php/user/login';
$HTTP_path = $system_path . '/tests/http.php/user/login';
$https_path = $system_path . '/tests/https.php/user/login';
// Generate a valid simpletest User-Agent to pass validation.
$this->assertTrue(preg_match('/simpletest\d+/', $this->databasePrefix, $matches), 'Database prefix contains simpletest prefix.');
$test_ua = drupal_generate_test_ua($matches[0]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment