Skip to content

Commit

Permalink
Issue #3123068 by longwave: Fix 'Drupal.Semantics.FunctionT.ConcatStr…
Browse files Browse the repository at this point in the history
…ing' coding standard

(cherry picked from commit 0955fd04587efe4aa6fda1de5ebba61a97762d86)
  • Loading branch information
alexpott committed May 29, 2020
1 parent b3c42c9 commit e2582d6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ public function getConfig(Editor $editor) {
* {@inheritdoc}
*/
public function getButtons() {
$label = $this->t('Language');
return [
'Language' => [
'label' => $this->t('Language'),
'label' => $label,
'image_alternative' => [
'#type' => 'inline_template',
'#template' => '<a href="#" class="cke-icon-only" role="button" title="' . $this->t('Language') . '" aria-label="' . $this->t('Language') . '"><span class="cke_button_icon cke_button__language_icon">' . $this->t('Language') . '</span></a>',
'#template' => '<a href="#" class="cke-icon-only" role="button" title="' . $label . '" aria-label="' . $label . '"><span class="cke_button_icon cke_button__language_icon">' . $label . '</span></a>',
],
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testTableSortDefaultSort() {

// Verify that the header links are built properly.
$assert->linkByHrefExists('database_test/tablesort_default_sort');
$assert->responseMatches('/\<a.*title\=\"' . t('sort by Username') . '\".*\>/');
$assert->responseMatches('/\<a.*title\=\"sort by Username\".*\>/');
}

}
6 changes: 3 additions & 3 deletions modules/user/tests/src/Functional/UserBlocksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public function testUserLoginBlock() {
$this->assertEqual('MISS', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
$this->drupalPostForm(NULL, $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertPattern('!<title.*?' . t('Compose tips') . '.*?</title>!', 'Still on the same page after login for allowed page');
$this->assertPattern('!<title.*?Compose tips.*?</title>!', 'Still on the same page after login for allowed page');

// Log out again and repeat with a non-403 page including query arguments.
$this->drupalLogout();
$this->drupalGet('filter/tips', ['query' => ['foo' => 'bar']]);
$this->assertEqual('HIT', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
$this->drupalPostForm(NULL, $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertPattern('!<title.*?' . t('Compose tips') . '.*?</title>!', 'Still on the same page after login for allowed page');
$this->assertPattern('!<title.*?Compose tips.*?</title>!', 'Still on the same page after login for allowed page');
$this->assertStringContainsString('/filter/tips?foo=bar', $this->getUrl(), 'Correct query arguments are displayed after login');

// Repeat with different query arguments.
Expand All @@ -105,7 +105,7 @@ public function testUserLoginBlock() {
$this->assertEqual('HIT', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
$this->drupalPostForm(NULL, $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertPattern('!<title.*?' . t('Compose tips') . '.*?</title>!', 'Still on the same page after login for allowed page');
$this->assertPattern('!<title.*?Compose tips.*?</title>!', 'Still on the same page after login for allowed page');
$this->assertStringContainsString('/filter/tips?foo=baz', $this->getUrl(), 'Correct query arguments are displayed after login');

// Check that the user login block is not vulnerable to information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testChangedField() {

$this->drupalGet($path, $options);

$this->assertText(t('Updated date') . ': ' . date('Y-m-d', REQUEST_TIME));
$this->assertText('Updated date: ' . date('Y-m-d', REQUEST_TIME));
}

}
1 change: 0 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
<rule ref="Drupal.Semantics.FunctionAlias"/>
<rule ref="Drupal.Semantics.FunctionT">
<exclude name="Drupal.Semantics.FunctionT.NotLiteralString"/>
<exclude name="Drupal.Semantics.FunctionT.ConcatString"/>
</rule>
<rule ref="Drupal.Semantics.FunctionWatchdog"/>
<rule ref="Drupal.Semantics.InstallHooks"/>
Expand Down

0 comments on commit e2582d6

Please sign in to comment.