Commit f4fd2d73 authored by catch's avatar catch
Browse files

Issue #3166349 by paulocs, snehalgaikwad, naresh_bavaskar, mondrake: Remove...

Issue #3166349 by paulocs, snehalgaikwad, naresh_bavaskar, mondrake: Remove uses of t() in assertNoText()
parent 99b9ff85
......@@ -166,7 +166,7 @@ public function testBlockContentTypeDeletion() {
t('%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', ['%label' => $type->label()]),
'The block type will not be deleted until all blocks of that type are removed.'
);
$this->assertNoText(t('This action cannot be undone.'), 'The block type deletion confirmation form is not available.');
$this->assertNoText('This action cannot be undone.', 'The block type deletion confirmation form is not available.');
// Delete the block.
$block->delete();
......
......@@ -61,7 +61,7 @@ public function testRecentCommentBlock() {
$this->drupalLogout();
user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']);
$this->drupalGet('');
$this->assertNoText(t('Recent comments'));
$this->assertNoText('Recent comments');
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']);
// Test that a user with the 'access comments' permission can see the
......
......@@ -81,7 +81,7 @@ public function testBookCommentPrint() {
$this->assertText($comment_subject, 'Comment subject found');
$this->assertText($comment_body, 'Comment body found');
$this->assertNoText(t('Add new comment'), 'Comment form not found');
$this->assertNoText('Add new comment', 'Comment form not found');
// Verify that the comment form subject field is not found.
$this->assertSession()->fieldNotExists('subject[0][value]');
}
......
......@@ -180,7 +180,7 @@ public function testCommentFieldCreate() {
];
$this->drupalPostForm('admin/config/people/accounts/fields/user.user.field_user_comment/storage', $edit, t('Save field settings'));
// We shouldn't get an error message.
$this->assertNoText(t('An illegal choice has been detected. Please contact the site administrator.'));
$this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
}
/**
......
......@@ -343,8 +343,8 @@ public function testTwoPagers() {
$account = $this->drupalCreateUser(['administer node display']);
$this->drupalLogin($account);
$this->drupalGet('admin/structure/types/manage/article/display');
$this->assertNoText(t('Pager ID: @id', ['@id' => 0]), 'No summary for standard pager');
$this->assertText(t('Pager ID: @id', ['@id' => 1]));
$this->assertNoText('Pager ID: 0', 'No summary for standard pager');
$this->assertText('Pager ID: 1');
$this->drupalPostForm(NULL, [], 'comment_settings_edit');
// Change default pager to 2.
$this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 2], t('Save'));
......@@ -352,7 +352,7 @@ public function testTwoPagers() {
// Revert the changes.
$this->drupalPostForm(NULL, [], 'comment_settings_edit');
$this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 0], t('Save'));
$this->assertNoText(t('Pager ID: @id', ['@id' => 0]), 'No summary for standard pager');
$this->assertNoText('Pager ID: 0', 'No summary for standard pager');
$this->drupalLogin($this->adminUser);
......
......@@ -168,7 +168,7 @@ public function testCommentTypeDeletion() {
]),
'The comment type will not be deleted until all fields of that type are removed.'
);
$this->assertNoText(t('This action cannot be undone.'), 'The comment type deletion confirmation form is not available.');
$this->assertNoText('This action cannot be undone.', 'The comment type deletion confirmation form is not available.');
// Delete the comment and the field.
$comment->delete();
......
......@@ -66,10 +66,10 @@ public function testConfigDependencyDeleteFormTrait() {
$entity2->save();
$this->drupalGet($entity2->toUrl('delete-form'));
$this->assertNoText(t('Configuration updates'), 'No configuration updates found.');
$this->assertNoText(t('Configuration deletions'), 'No configuration deletes found.');
$this->assertNoText('Configuration updates', 'No configuration updates found.');
$this->assertNoText('Configuration deletions', 'No configuration deletes found.');
$this->drupalGet($entity1->toUrl('delete-form'));
$this->assertNoText(t('Configuration updates'), 'No configuration updates found.');
$this->assertNoText('Configuration updates', 'No configuration updates found.');
$this->assertText(t('Configuration deletions'), 'Configuration deletions found.');
$this->assertText($entity2->id(), 'Entity2 id found');
$this->drupalPostForm($entity1->toUrl('delete-form'), [], 'Delete');
......@@ -118,7 +118,7 @@ public function testConfigDependencyDeleteFormTrait() {
$this->drupalGet($entity1->toUrl('delete-form'));
$this->assertText(t('Configuration updates'), 'Configuration updates found.');
$this->assertNoText(t('Configuration deletions'), 'No configuration deletions found.');
$this->assertNoText('Configuration deletions', 'No configuration deletions found.');
$this->assertNoText($entity2->id(), 'Entity2 id not found');
$this->assertText($entity2->label(), 'Entity2 label not found');
$this->assertNoText($entity3->id(), 'Entity3 id not found');
......
......@@ -91,7 +91,7 @@ protected function setUp(): void {
public function testExportImport() {
// After installation there is no snapshot and nothing to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('Warning message'));
$this->assertNoText('Warning message');
$this->assertText(t('There are no configuration changes to import.'));
$this->originalSlogan = $this->config('system.site')->get('slogan');
......@@ -168,13 +168,13 @@ public function testExportImport() {
file_put_contents($filename, $this->tarball);
$this->drupalPostForm('admin/config/development/configuration/full/import', ['files[import_tarball]' => $filename], 'Upload');
// There is no snapshot yet because an import has never run.
$this->assertNoText(t('Warning message'));
$this->assertNoText(t('There are no configuration changes to import.'));
$this->assertNoText('Warning message');
$this->assertNoText('There are no configuration changes to import.');
$this->assertText($this->contentType->label());
$this->drupalPostForm(NULL, [], 'Import all');
// After importing the snapshot has been updated an there are no warnings.
$this->assertNoText(t('Warning message'));
$this->assertNoText('Warning message');
$this->assertText(t('There are no configuration changes to import.'));
$this->assertEquals($this->newSlogan, $this->config('system.site')->get('slogan'));
......@@ -195,7 +195,7 @@ public function testExportImport() {
// active and snapshot should no longer exist.
\Drupal::service('config.storage.sync')->deleteAll();
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('Warning message'));
$this->assertNoText('Warning message');
$this->assertNoText('The following items in your active configuration have changes since the last import that may be lost on the next import.');
$this->assertText(t('There are no configuration changes to import.'));
// Write a file to sync. The warning about differences between the active
......@@ -278,7 +278,7 @@ public function testExportImportCollections() {
$this->drupalPostForm('admin/config/development/configuration/full/import', ['files[import_tarball]' => $filename], 'Upload');
// Verify that there are configuration differences to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('There are no configuration changes to import.'));
$this->assertNoText('There are no configuration changes to import.');
$this->assertText(t('@collection configuration collection', ['@collection' => 'collection.test1']));
$this->assertText(t('@collection configuration collection', ['@collection' => 'collection.test2']));
$this->assertText('config_test.create');
......
......@@ -238,7 +238,7 @@ public function testImportLock() {
// Verify that there are configuration differences to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('There are no configuration changes to import.'));
$this->assertNoText('There are no configuration changes to import.');
// Acquire a fake-lock on the import mechanism.
$config_importer = $this->configImporter();
......@@ -362,7 +362,7 @@ public function testImportValidation() {
$this->prepareSiteNameUpdate($new_site_name);
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('There are no configuration changes to import.'));
$this->assertNoText('There are no configuration changes to import.');
$this->drupalPostForm(NULL, [], t('Import all'));
// Verify that the validation messages appear.
......@@ -439,13 +439,13 @@ public function testImportErrorLog() {
$sync->write($name_secondary, $values_secondary);
// Verify that there are configuration differences to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertNoText(t('There are no configuration changes to import.'));
$this->assertNoText('There are no configuration changes to import.');
// Attempt to import configuration and verify that an error message appears.
$this->drupalPostForm(NULL, [], t('Import all'));
$this->assertText(new FormattableMarkup('Deleted and replaced configuration entity "@name"', ['@name' => $name_secondary]));
$this->assertText(t('The configuration was imported with errors.'));
$this->assertNoText(t('The configuration was imported successfully.'));
$this->assertNoText('The configuration was imported successfully.');
$this->assertText(t('There are no configuration changes to import.'));
}
......
......@@ -897,8 +897,8 @@ public function testAlterInfo() {
// Check if the translation page does not have the altered out settings.
$this->drupalGet('admin/config/people/accounts/translate/fr/add');
$this->assertText(t('Name'));
$this->assertNoText(t('Account cancellation confirmation'));
$this->assertNoText(t('Password recovery'));
$this->assertNoText('Account cancellation confirmation');
$this->assertNoText('Password recovery');
}
/**
......
......@@ -214,7 +214,7 @@ public function testSiteWideContact() {
$this->drupalLogout();
$this->drupalGet('contact');
$this->assertText(t('Your email address'));
$this->assertNoText(t('Form'));
$this->assertNoText('Form');
$this->drupalLogin($admin_user);
// Add more forms.
......@@ -226,7 +226,7 @@ public function testSiteWideContact() {
// Try adding a form that already exists.
$this->addContactForm($name, $label, '', '', FALSE);
$this->assertNoText(t('Contact form @label has been added.', ['@label' => $label]));
$this->assertNoText("Contact form $label has been added.");
$this->assertRaw(t('The machine-readable name is already in use. It must be unique.'));
$this->drupalLogout();
......
......@@ -61,7 +61,7 @@ public function testContactStorage() {
$this->drupalLogout();
$this->drupalGet('contact');
$this->assertText(t('Your email address'));
$this->assertNoText(t('Form'));
$this->assertNoText('Form');
$this->submitContact($name = $this->randomMachineName(16), $mail, $subject = $this->randomMachineName(16), $id, $message = $this->randomMachineName(64));
$this->assertText(t('Your message has been sent.'));
......
......@@ -107,8 +107,8 @@ public function testDeleteField() {
// Check the config dependencies of the first field, the field storage must
// not be shown as being deleted yet.
$this->drupalGet("$bundle_path1/fields/node.$type_name1.$field_name/delete");
$this->assertNoText(t('The listed configuration will be deleted.'));
$this->assertNoText(t('View'));
$this->assertNoText('The listed configuration will be deleted.');
$this->assertNoText('View');
$this->assertNoText('test_view_field_delete');
// Delete the first field.
......
......@@ -581,7 +581,7 @@ public function createForumTopic($forum, $container = FALSE) {
$type = t('Forum topic');
if ($container) {
$this->assertNoText(t('@type @title has been created.', ['@type' => $type, '@title' => $title]), 'Forum topic was not created');
$this->assertNoText("$type $title has been created.", 'Forum topic was not created');
$this->assertRaw(t('The item %title is a forum container, not a forum.', ['%title' => $forum['name']]), 'Error message was shown');
return;
}
......
......@@ -386,7 +386,7 @@ public function testEditEffect() {
$this->assertText(t('Scale and crop 360×240'));
// Check that the previous effect is replaced.
$this->assertNoText(t('Scale and crop 300×200'));
$this->assertNoText('Scale and crop 300×200');
// Add another scale effect.
$this->drupalGet('admin/config/media/image-styles/add');
......
......@@ -198,8 +198,8 @@ public function testRequiredAttributes() {
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
$this->assertNoText('Alternative text field is required.');
$this->assertNoText('Title field is required.');
$instance->setSetting('required', 0);
$instance->setSetting('alt_field_required', 1);
......@@ -211,8 +211,8 @@ public function testRequiredAttributes() {
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
$this->assertNoText('Alternative text field is required.');
$this->assertNoText('Title field is required.');
}
/**
......
......@@ -101,7 +101,7 @@ public function testLanguageConfiguration() {
'prefix[fr]' => '',
];
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->assertNoText(t('The prefix may only be left blank for the selected detection fallback language.'), 'The path prefix can be removed for the default language');
$this->assertNoText('The prefix may only be left blank for the selected detection fallback language.', 'The path prefix can be removed for the default language');
// Change default negotiation language.
$this->config('language.negotiation')->set('selected_langcode', 'fr')->save();
......
......@@ -325,7 +325,7 @@ public function testLinkTitle() {
"{$field_name}[0][uri]" => '',
];
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertNoText(t('@name field is required.', ['@name' => t('Link text')]));
$this->assertNoText('Link text field is required.');
// Verify that a URL and link text meets requirements.
$this->drupalGet('entity_test/add');
......@@ -334,7 +334,7 @@ public function testLinkTitle() {
"{$field_name}[0][title]" => 'Example',
];
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertNoText(t('@name field is required.', ['@name' => t('Link text')]));
$this->assertNoText('Link text field is required.');
}
}
}
......
......@@ -186,7 +186,7 @@ public function testStandalonePoFile() {
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'String overwritten by imported string.');
$this->assertNoText('No strings available.', 'String overwritten by imported string.');
// This import should have changed number of plural forms.
$locale_plurals = \Drupal::service('locale.plural.formula')->reset()->getNumberOfPlurals('fr');
$this->assertEqual(3, $locale_plurals, 'Plural numbers changed.');
......@@ -245,7 +245,7 @@ public function testStandalonePoFile() {
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'Customized string overwritten by imported string.');
$this->assertNoText('No strings available.', 'Customized string overwritten by imported string.');
}
......
......@@ -218,7 +218,7 @@ public function testStringTranslation() {
'translation' => 'untranslated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'The translation has been removed');
$this->assertNoText('No strings available.', 'The translation has been removed');
}
/**
......@@ -342,7 +342,7 @@ public function testStringValidation() {
// Check for a form error on the textarea.
$form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class');
$this->assertStringContainsString('error', $form_class[0]->getText(), 'The string was rejected as unsafe.');
$this->assertNoText(t('The string has been saved.'), 'The string was not saved.');
$this->assertNoText('The string has been saved.', 'The string was not saved.');
}
}
......@@ -423,7 +423,7 @@ public function testStringSearch() {
'translation' => 'untranslated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'Search found the string.');
$this->assertNoText('No strings available.', 'Search found the string.');
// Add translation.
// Assume this is the only result, given the random name.
......@@ -443,7 +443,7 @@ public function testStringSearch() {
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'Search found the translation.');
$this->assertNoText('No strings available.', 'Search found the translation.');
// Ensure translated source string doesn't appear if searching on 'only
// untranslated strings'.
......@@ -472,7 +472,7 @@ public function testStringSearch() {
'translation' => 'all',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'Search found the translation.');
$this->assertNoText('No strings available.', 'Search found the translation.');
// Ensure translated string doesn't appear if searching in System (English).
$search = [
......
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