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
......@@ -78,7 +78,7 @@ function simpletest_test_stub_settings_function() {}
}
EOD;
file_put_contents($this->siteDirectory. '/' . 'settings.testing.php', $php);
file_put_contents($this->siteDirectory . '/' . 'settings.testing.php', $php);
// @see \Drupal\system\Tests\DrupalKernel\DrupalKernelSiteTest
$class = __CLASS__;
$yaml = <<<EOD
......
......@@ -625,7 +625,7 @@ protected function prepareSettings() {
copy($settings_testing_file, $directory . '/settings.testing.php');
// Add the name of the testing class to settings.php and include the
// testing specific overrides
file_put_contents($directory . '/settings.php', "\n\$test_class = '" . get_class($this) ."';\n" . 'include DRUPAL_ROOT . \'/\' . $site_path . \'/settings.testing.php\';' ."\n", FILE_APPEND);
file_put_contents($directory . '/settings.php', "\n\$test_class = '" . get_class($this) . "';\n" . 'include DRUPAL_ROOT . \'/\' . $site_path . \'/settings.testing.php\';' . "\n", FILE_APPEND);
}
$settings_services_file = DRUPAL_ROOT . '/' . $this->originalSite . '/testing.services.yml';
if (!file_exists($settings_services_file)) {
......
......@@ -16,7 +16,7 @@
class SimpletestPhpunitRunCommandTest extends UnitTestCase {
function testSimpletestPhpUnitRunCommand() {
include_once __DIR__ .'/../../fixtures/simpletest_phpunit_run_command_test.php';
include_once __DIR__ . '/../../fixtures/simpletest_phpunit_run_command_test.php';
$app_root = __DIR__ . '/../../../../../..';
include_once "$app_root/core/modules/simpletest/simpletest.module";
$container = new ContainerBuilder();
......
......@@ -75,7 +75,7 @@ function testStatisticsSettings() {
$nid = $this->testNode->id();
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$this->client->post($stats_path, array('form_params' => $post));
// Hit the node again (the counter is incremented after the hit, so
......@@ -110,7 +110,7 @@ function testDeleteNode() {
$nid = $this->testNode->id();
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$this->client->post($stats_path, array('form_params' => $post));
$result = db_select('node_counter', 'n')
......@@ -144,7 +144,7 @@ function testExpiredLogs() {
$nid = $this->testNode->id();
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$this->client->post($stats_path, array('form_params' => $post));
$this->drupalGet('node/' . $this->testNode->id());
$this->client->post($stats_path, array('form_params' => $post));
......
......@@ -24,7 +24,7 @@ function testPopularContentBlock() {
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$client = \Drupal::service('http_client_factory')
->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]);
$client->post($stats_path, array('headers' => $headers, 'body' => $post));
......
......@@ -27,7 +27,7 @@ function testStatisticsTokenReplacement() {
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$client = \Drupal::service('http_client_factory')
->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]);
$client->post($stats_path, array('headers' => $headers, 'body' => $post));
......
......@@ -70,7 +70,7 @@ public function testNodeCounterIntegration() {
// Manually calling statistics.php, simulating ajax behavior.
// @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging().
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php';
$client = \Drupal::service('http_client_factory')->fromOptions(['config/curl', array(CURLOPT_TIMEOUT => 10)]);
$client->post($stats_path, array('form_params' => array('nid' => $this->node->id())));
$this->drupalGet('test_statistics_integration');
......
......@@ -259,7 +259,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
if (!empty($module->info['required'])) {
// Used when displaying modules that are required by the installation profile
$row['enable']['#disabled'] = TRUE;
$row['#required_by'][] = $distribution . (!empty($module->info['explanation']) ? ' ('. $module->info['explanation'] .')' : '');
$row['#required_by'][] = $distribution . (!empty($module->info['explanation']) ? ' (' . $module->info['explanation'] . ')' : '');
}
// Check the compatibilities.
......
......@@ -181,7 +181,7 @@ function testBatchLargePercentage() {
* TRUE on pass, FALSE on fail.
*/
function assertBatchMessages($texts, $message) {
$pattern = '|' . implode('.*', $texts) .'|s';
$pattern = '|' . implode('.*', $texts) . '|s';
return $this->assertPattern($pattern, $message);
}
......
......@@ -107,7 +107,7 @@ function testUriFunctions() {
* Test some file handle functions.
*/
function testFileFunctions() {
$filename = 'public://'. $this->randomMachineName();
$filename = 'public://' . $this->randomMachineName();
file_put_contents($filename, str_repeat('d', 1000));
// Open for rw and place pointer at beginning of file so select will return.
......
......@@ -248,7 +248,7 @@ function testManipulations() {
}
// Prepare a directory for test file results.
$directory = $this->publicFilesDirectory .'/imagetest';
$directory = $this->publicFilesDirectory . '/imagetest';
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
foreach ($files as $file) {
......@@ -424,7 +424,7 @@ public function testResourceDestruction() {
*/
function testGifTransparentImages() {
// Prepare a directory for test file results.
$directory = $this->publicFilesDirectory .'/imagetest';
$directory = $this->publicFilesDirectory . '/imagetest';
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
// Test loading an indexed GIF image with transparent color set.
......
......@@ -91,7 +91,7 @@ function assertModuleTablesDoNotExist($module) {
* TRUE if configuration has been installed, FALSE otherwise.
*/
function assertModuleConfig($module) {
$module_config_dir = drupal_get_path('module', $module) . '/'. InstallStorage::CONFIG_INSTALL_DIRECTORY;
$module_config_dir = drupal_get_path('module', $module) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
if (!is_dir($module_config_dir)) {
return;
}
......
......@@ -23,7 +23,7 @@ function testIndexPhpHandling() {
$this->drupalGet($index_php, array('external' => TRUE));
$this->assertResponse(200, 'Make sure index.php returns a valid page.');
$this->drupalGet($index_php .'/user', array('external' => TRUE));
$this->drupalGet($index_php . '/user', array('external' => TRUE));
$this->assertResponse(200, 'Make sure index.php/user returns a valid page.');
}
}
......@@ -114,7 +114,7 @@ protected function testSiteMaintenance() {
);
$this->drupalPostForm('user/password', $edit, t('Submit'));
$mails = $this->drupalGetMails();
$start = strpos($mails[0]['body'], 'user/reset/'. $this->user->id());
$start = strpos($mails[0]['body'], 'user/reset/' . $this->user->id());
$path = substr($mails[0]['body'], $start, 66 + strlen($this->user->id()));
// Log in with temporary login link.
......
......@@ -278,7 +278,7 @@ function testLinks() {
$expected_links .= '<li data-drupal-link-system-path="router_test/test1" class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Test route') . '</a></li>';
$query = array('key' => 'value');
$encoded_query = Html::escape(Json::encode($query));
$expected_links .= '<li data-drupal-link-query="'.$encoded_query.'" data-drupal-link-system-path="router_test/test1" class="query-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '" data-drupal-link-query="'.$encoded_query.'" data-drupal-link-system-path="router_test/test1">' . Html::escape('Query test route') . '</a></li>';
$expected_links .= '<li data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1" class="query-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1', $query) . '" data-drupal-link-query="' . $encoded_query . '" data-drupal-link-system-path="router_test/test1">' . Html::escape('Query test route') . '</a></li>';
$expected_links .= '</ul>';
$expected = $expected_heading . $expected_links;
$this->assertThemeOutput('links', $variables, $expected);
......
......@@ -90,7 +90,7 @@ function _batch_test_nested_batch_callback() {
function _batch_test_finished_helper($batch_id, $success, $results, $operations) {
if ($results) {
foreach ($results as $op => $op_results) {
$messages[] = 'op '. Html::escape($op) . ': processed ' . count($op_results) . ' elements';
$messages[] = 'op ' . Html::escape($op) . ': processed ' . count($op_results) . ' elements';
}
}
else {
......
......@@ -23,7 +23,7 @@ function _batch_test_batch_0() {
$batch = array(
'operations' => array(),
'finished' => '_batch_test_finished_0',
'file' => drupal_get_path('module', 'batch_test'). '/batch_test.callbacks.inc',
'file' => drupal_get_path('module', 'batch_test') . '/batch_test.callbacks.inc',
);
return $batch;
}
......@@ -45,7 +45,7 @@ function _batch_test_batch_1() {
$batch = array(
'operations' => $operations,
'finished' => '_batch_test_finished_1',
'file' => drupal_get_path('module', 'batch_test'). '/batch_test.callbacks.inc',
'file' => drupal_get_path('module', 'batch_test') . '/batch_test.callbacks.inc',
);
return $batch;
}
......@@ -148,7 +148,7 @@ function _batch_test_batch_5() {
$batch = array(
'operations' => $operations,
'finished' => '_batch_test_finished_5',
'file' => drupal_get_path('module', 'batch_test'). '/batch_test.callbacks.inc',
'file' => drupal_get_path('module', 'batch_test') . '/batch_test.callbacks.inc',
);
return $batch;
}
......
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