Issue #3166349 by paulocs, snehalgaikwad, naresh_bavaskar, mondrake: Remove uses of t() in assertNoText()

merge-requests/7/head
catch 2020-08-28 12:48:09 +01:00
parent 99b9ff858a
commit f4fd2d7336
53 changed files with 145 additions and 145 deletions

View File

@ -166,7 +166,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
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();

View File

@ -61,7 +61,7 @@ class CommentBlockTest extends CommentTestBase {
$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

View File

@ -81,7 +81,7 @@ class CommentBookTest extends BrowserTestBase {
$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]');
}

View File

@ -180,7 +180,7 @@ class CommentFieldsTest extends CommentTestBase {
];
$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.');
}
/**

View File

@ -343,8 +343,8 @@ class CommentPagerTest extends CommentTestBase {
$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 @@ class CommentPagerTest extends CommentTestBase {
// 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);

View File

@ -168,7 +168,7 @@ class CommentTypeTest extends CommentTestBase {
]),
'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();

View File

@ -66,10 +66,10 @@ class ConfigDependencyWebTest extends BrowserTestBase {
$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 @@ class ConfigDependencyWebTest extends BrowserTestBase {
$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');

View File

@ -91,7 +91,7 @@ class ConfigExportImportUITest extends BrowserTestBase {
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 @@ class ConfigExportImportUITest extends BrowserTestBase {
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 @@ class ConfigExportImportUITest extends BrowserTestBase {
// 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 @@ class ConfigExportImportUITest extends BrowserTestBase {
$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');

View File

@ -238,7 +238,7 @@ class ConfigImportUITest extends BrowserTestBase {
// 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 @@ class ConfigImportUITest extends BrowserTestBase {
$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 @@ class ConfigImportUITest extends BrowserTestBase {
$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.'));
}

View File

@ -897,8 +897,8 @@ class ConfigTranslationUiTest extends BrowserTestBase {
// 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');
}
/**

View File

@ -214,7 +214,7 @@ class ContactSitewideTest extends BrowserTestBase {
$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 @@ class ContactSitewideTest extends BrowserTestBase {
// 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();

View File

@ -61,7 +61,7 @@ class ContactStorageTest extends ContactSitewideTest {
$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.'));

View File

@ -107,8 +107,8 @@ class FieldUIDeleteTest extends BrowserTestBase {
// 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.

View File

@ -581,7 +581,7 @@ class ForumTest extends BrowserTestBase {
$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;
}

View File

@ -386,7 +386,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
$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');

View File

@ -198,8 +198,8 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
];
$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 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
];
$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.');
}
/**

View File

@ -101,7 +101,7 @@ class LanguageConfigurationTest extends BrowserTestBase {
'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();

View File

@ -325,7 +325,7 @@ class LinkFieldTest extends BrowserTestBase {
"{$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 @@ class LinkFieldTest extends BrowserTestBase {
"{$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.');
}
}
}

View File

@ -186,7 +186,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
'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 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
'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.');
}

View File

@ -218,7 +218,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
'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 @@ class LocaleTranslationUiTest extends BrowserTestBase {
// 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 @@ class LocaleTranslationUiTest extends BrowserTestBase {
'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 @@ class LocaleTranslationUiTest extends BrowserTestBase {
'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 @@ class LocaleTranslationUiTest extends BrowserTestBase {
'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 = [

View File

@ -49,7 +49,7 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
// No language added.
// Check status page and Available translation updates page.
$this->drupalGet('admin/reports/status');
$this->assertNoText(t('Translation update status'), 'No status message');
$this->assertNoText('Translation update status', 'No status message');
$this->drupalGet('admin/reports/translations');
$this->assertRaw(t('No translatable languages available. <a href=":add_language">Add a language</a> first.', [':add_language' => Url::fromRoute('entity.configurable_language.collection')->toString()]), 'Language message');

View File

@ -431,7 +431,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'String successfully imported.');
$this->assertNoText('No strings available.', 'String successfully imported.');
// Ensure the multiline string was imported.
$search = [

View File

@ -94,7 +94,7 @@ class MenuUiNodeTest extends BrowserTestBase {
// Verify that no menu settings are displayed and nodes can be created.
$this->drupalGet('node/add/page');
$this->assertText(t('Create Basic page'));
$this->assertNoText(t('Menu settings'));
$this->assertNoText('Menu settings');
$node_title = $this->randomMachineName();
$edit = [
'title[0][value]' => $node_title,

View File

@ -36,7 +36,7 @@ class MigrateAccessTest extends BrowserTestBase {
$this->drupalLogin($user);
$this->drupalGet('upgrade');
$this->assertSession()->statusCodeEquals(403);
$this->assertNoText(t('Upgrade'));
$this->assertNoText('Upgrade');
}
}

View File

@ -189,7 +189,7 @@ class NodeTypeTest extends NodeTestBase {
t('%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', ['%type' => $type->label()]),
'The content type will not be deleted until all nodes of that type are removed.'
);
$this->assertNoText(t('This action cannot be undone.'), 'The node type deletion confirmation form is not available.');
$this->assertNoText('This action cannot be undone.', 'The node type deletion confirmation form is not available.');
// Delete the node.
$node->delete();

View File

@ -115,7 +115,7 @@ class SearchBlockTest extends BrowserTestBase {
// search again with a longer keyword. First test using the block form.
$this->drupalPostForm('node', ['keys' => $this->randomMachineName(1)], t('Search'));
$this->assertText('You must include at least one keyword to match in the content', 'Keyword message is displayed when searching for short word');
$this->assertNoText(t('Please enter some keywords'), 'With short word entered, no keywords message is not displayed');
$this->assertNoText('Please enter some keywords', 'With short word entered, no keywords message is not displayed');
$this->drupalPostForm(NULL, ['keys' => $this->randomMachineName()], t('Search'), [], 'search-block-form');
$this->assertNoText('You must include at least one keyword to match in the content', 'Keyword message is not displayed when searching for long word after short word search');

View File

@ -105,7 +105,7 @@ class SearchCommentCountToggleTest extends BrowserTestBase {
$this->searchableNodes['1 comment']->save();
$this->drupalPostForm(NULL, $edit, t('Search'));
$this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Closed');
$this->assertNoText('0 comments', 'Empty comment count does not display for nodes with comment status set to Closed');
$this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Closed');
// Test comment count display for nodes with comment status set to Hidden
@ -115,8 +115,8 @@ class SearchCommentCountToggleTest extends BrowserTestBase {
$this->searchableNodes['1 comment']->save();
$this->drupalPostForm(NULL, $edit, t('Search'));
$this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Hidden');
$this->assertNoText(t('1 comment'), 'Non-empty comment count does not display for nodes with comment status set to Hidden');
$this->assertNoText('0 comments', 'Empty comment count does not display for nodes with comment status set to Hidden');
$this->assertNoText('1 comment', 'Non-empty comment count does not display for nodes with comment status set to Hidden');
}
}

View File

@ -361,7 +361,7 @@ class SearchCommentTest extends BrowserTestBase {
// not be part of the search snippet.
$this->drupalPostForm('search/node', ['keys' => 'short'], t('Search'));
$this->assertText($node->label(), 'Search for keyword worked');
$this->assertNoText(t('Add new comment'));
$this->assertNoText('Add new comment');
}
}

View File

@ -107,7 +107,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
'minimum_word_size' => $this->randomMachineName(3),
];
$this->drupalPostForm('admin/config/search/pages', $edit, t('Save configuration'));
$this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.');
$this->assertNoText('The configuration options have been saved.', 'Form does not save with an invalid word length.');
// Test logging setting. It should be off by default.
$text = $this->randomMachineName(5);

View File

@ -86,7 +86,7 @@ class SearchEmbedFormTest extends BrowserTestBase {
$this->drupalPostForm('search',
['keys' => 'foo'],
t('Search'));
$this->assertNoText(t('Test form was submitted'), 'Form message does not appear');
$this->assertNoText('Test form was submitted', 'Form message does not appear');
$count = \Drupal::state()->get('search_embedded_form.submit_count');
$this->assertEqual($this->submitCount, $count, 'Form submission count is correct');
$this->submitCount = $count;

View File

@ -83,7 +83,7 @@ class SearchPageTextTest extends BrowserTestBase {
$title_source = 'Search for @keywords | Drupal';
$this->assertSession()->titleEquals('Search for ' . Unicode::truncate($search_terms, 60, TRUE, TRUE) . ' | Drupal');
$this->assertNoText('Node', 'Erroneous tab and breadcrumb text is not present');
$this->assertNoText(t('Node'), 'Erroneous translated tab and breadcrumb text is not present');
$this->assertNoText('Node', 'Erroneous translated tab and breadcrumb text is not present');
$this->assertText(t('Content'), 'Tab and breadcrumb text is present');
$this->clickLink('About searching');
@ -145,16 +145,16 @@ class SearchPageTextTest extends BrowserTestBase {
// Make sure the "Please enter some keywords" message is NOT displayed if
// you use "or" words or phrases in Advanced Search.
$this->drupalPostForm('search/node', ['or' => $this->randomMachineName() . ' ' . $this->randomMachineName()], 'edit-submit--2');
$this->assertNoText(t('Please enter some keywords'), 'With advanced OR keywords entered, no keywords message is not displayed on node page');
$this->assertNoText('Please enter some keywords', 'With advanced OR keywords entered, no keywords message is not displayed on node page');
$this->drupalPostForm('search/node', ['phrase' => '"' . $this->randomMachineName() . '" "' . $this->randomMachineName() . '"'], 'edit-submit--2');
$this->assertNoText(t('Please enter some keywords'), 'With advanced phrase entered, no keywords message is not displayed on node page');
$this->assertNoText('Please enter some keywords', 'With advanced phrase entered, no keywords message is not displayed on node page');
// Verify that if you search for a too-short keyword, you get the right
// message, and that if after that you search for a longer keyword, you
// do not still see the message.
$this->drupalPostForm('search/node', ['keys' => $this->randomMachineName(1)], t('Search'));
$this->assertText('You must include at least one keyword', 'Keyword message is displayed when searching for short word');
$this->assertNoText(t('Please enter some keywords'), 'With short word entered, no keywords message is not displayed');
$this->assertNoText('Please enter some keywords', 'With short word entered, no keywords message is not displayed');
$this->drupalPostForm(NULL, ['keys' => $this->randomMachineName()], t('Search'));
$this->assertNoText('You must include at least one keyword', 'Keyword message is not displayed when searching for long word after short word search');

View File

@ -28,12 +28,12 @@ class ElementsAccessTest extends BrowserTestBase {
*/
public function testAccessFalse() {
$this->drupalPostForm('form_test/vertical-tabs-access', NULL, t('Submit'));
$this->assertNoText(t('This checkbox inside a vertical tab does not have its default value.'));
$this->assertNoText(t('This textfield inside a vertical tab does not have its default value.'));
$this->assertNoText(t('This checkbox inside a fieldset does not have its default value.'));
$this->assertNoText(t('This checkbox inside a container does not have its default value.'));
$this->assertNoText(t('This checkbox inside a nested container does not have its default value.'));
$this->assertNoText(t('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.'));
$this->assertNoText('This checkbox inside a vertical tab does not have its default value.');
$this->assertNoText('This textfield inside a vertical tab does not have its default value.');
$this->assertNoText('This checkbox inside a fieldset does not have its default value.');
$this->assertNoText('This checkbox inside a container does not have its default value.');
$this->assertNoText('This checkbox inside a nested container does not have its default value.');
$this->assertNoText('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.');
$this->assertText(t('The form submitted correctly.'));
}

View File

@ -418,7 +418,7 @@ class FormTest extends BrowserTestBase {
'multiple_no_default',
];
foreach ($no_errors as $key) {
$this->assertNoText(t('@name field is required.', ['@name' => $form[$key]['#title']]));
$this->assertNoText($form[$key]['#title'] . ' field is required.');
}
$expected_errors = [

View File

@ -120,19 +120,19 @@ class ValidationTest extends BrowserTestBase {
// validated, but the #element_validate handler for the 'test' field
// is triggered.
$this->drupalPostForm($path, $edit, t('Partial validate'));
$this->assertNoText(t('@name field is required.', ['@name' => 'Title']));
$this->assertNoText('Title field is required.');
$this->assertText('Test element is invalid');
// Edge case of #limit_validation_errors containing numeric indexes: same
// thing with the 'Partial validate (numeric index)' button and the
// 'test_numeric_index' field.
$this->drupalPostForm($path, $edit, t('Partial validate (numeric index)'));
$this->assertNoText(t('@name field is required.', ['@name' => 'Title']));
$this->assertNoText('Title field is required.');
$this->assertText('Test (numeric index) element is invalid');
// Ensure something like 'foobar' isn't considered "inside" 'foo'.
$this->drupalPostForm($path, $edit, t('Partial validate (substring)'));
$this->assertNoText(t('@name field is required.', ['@name' => 'Title']));
$this->assertNoText('Title field is required.');
$this->assertText('Test (substring) foo element is invalid');
// Ensure not validated values are not available to submit handlers.
@ -219,15 +219,15 @@ class ValidationTest extends BrowserTestBase {
foreach (Element::children($form) as $key) {
if (isset($form[$key]['#required_error'])) {
$this->assertNoText(t('@name field is required.', ['@name' => $form[$key]['#title']]));
$this->assertNoText($form[$key]['#title'] . ' field is required.');
$this->assertText($form[$key]['#required_error']);
}
elseif (isset($form[$key]['#form_test_required_error'])) {
$this->assertNoText(t('@name field is required.', ['@name' => $form[$key]['#title']]));
$this->assertNoText($form[$key]['#title'] . ' field is required.');
$this->assertText($form[$key]['#form_test_required_error']);
}
}
$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.');
// Verify that no custom validation error appears with valid values.
$edit = [
@ -239,15 +239,15 @@ class ValidationTest extends BrowserTestBase {
foreach (Element::children($form) as $key) {
if (isset($form[$key]['#required_error'])) {
$this->assertNoText(t('@name field is required.', ['@name' => $form[$key]['#title']]));
$this->assertNoText($form[$key]['#title'] . ' field is required.');
$this->assertNoText($form[$key]['#required_error']);
}
elseif (isset($form[$key]['#form_test_required_error'])) {
$this->assertNoText(t('@name field is required.', ['@name' => $form[$key]['#title']]));
$this->assertNoText($form[$key]['#title'] . ' field is required.');
$this->assertNoText($form[$key]['#form_test_required_error']);
}
}
$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.');
}
}

View File

@ -80,7 +80,7 @@ class MenuRouterTest extends BrowserTestBase {
protected function doTestTitleCallbackFalse() {
$this->drupalGet('test-page');
$this->assertText('A title with @placeholder', 'Raw text found on the page');
$this->assertNoText(t('A title with @placeholder', ['@placeholder' => 'some other text']), 'Text with placeholder substitutions not found.');
$this->assertNoText('A title with some other text', 'Text with placeholder substitutions not found.');
}
/**
@ -89,7 +89,7 @@ class MenuRouterTest extends BrowserTestBase {
protected function doTestTitleMenuCallback() {
// Verify that the menu router item title is not visible.
$this->drupalGet('');
$this->assertNoText(t('Menu Callback Title'));
$this->assertNoText('Menu Callback Title');
// Verify that the menu router item title is output as page title.
$this->drupalGet('menu_callback_title');
$this->assertText(t('Menu Callback Title'));
@ -200,7 +200,7 @@ class MenuRouterTest extends BrowserTestBase {
"éøïвβ中國書۞";
$this->drupalGet($path);
$this->assertRaw('This is the menuTestCallback content.');
$this->assertNoText(t('The website encountered an unexpected error. Please try again later.'));
$this->assertNoText('The website encountered an unexpected error. Please try again later.');
}
/**

View File

@ -92,7 +92,7 @@ class SessionHttpsTest extends BrowserTestBase {
// Verify that user is not logged in on non-secure URL.
$this->drupalGet($this->httpUrl('admin/config'));
$this->assertNoText(t('Configuration'));
$this->assertNoText('Configuration');
$this->assertSession()->statusCodeEquals(403);
// Verify that empty SID cannot be used on the non-secure site.

View File

@ -208,7 +208,7 @@ class SessionTest extends BrowserTestBase {
$this->assertSessionCookie(FALSE);
// @todo Reinstate when REQUEST and RESPONSE events fire for cached pages.
// $this->assertSessionEmpty(TRUE);
$this->assertNoText(t('This is a dummy message.'), 'Message was not cached.');
$this->assertNoText('This is a dummy message.', 'Message was not cached.');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertNull($this->drupalGetHeader('Set-Cookie'), 'New session was not started.');
@ -222,7 +222,7 @@ class SessionTest extends BrowserTestBase {
$this->assertSessionCookie(FALSE);
// @todo Reinstate when REQUEST and RESPONSE events fire for cached pages.
// $this->assertSessionEmpty(TRUE);
$this->assertNoText(t('This is a dummy message.'), 'The message was not saved.');
$this->assertNoText('This is a dummy message.', 'The message was not saved.');
}
/**

View File

@ -241,7 +241,7 @@ class DateTimeTest extends BrowserTestBase {
$edit['field_dt[0][value][day]'] = '29';
$this->drupalPostForm('node/add/page_with_date', $edit, t('Save'));
$this->assertNoText(t('Selected combination of day and month is not valid.'), 'Correct date passed validation.');
$this->assertNoText('Selected combination of day and month is not valid.', 'Correct date passed validation.');
$this->drupalGet('node/1');
$this->assertText(t('Mon, 02/29/2016 - 01:30'), 'Node successfully created with valid date.');

View File

@ -65,7 +65,7 @@ class FrontPageTest extends BrowserTestBase {
$this->drupalGet('node');
$this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet($this->nodePath);
$this->assertNoText(t('On front page.'), 'Path is not the front page.');
$this->assertNoText('On front page.', 'Path is not the front page.');
// Change the front page to an invalid path.
$edit = ['site_frontpage' => '/kittens'];
@ -85,7 +85,7 @@ class FrontPageTest extends BrowserTestBase {
$this->drupalGet('');
$this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet('node');
$this->assertNoText(t('On front page.'), 'Path is not the front page.');
$this->assertNoText('On front page.', 'Path is not the front page.');
$this->drupalGet($this->nodePath);
$this->assertText(t('On front page.'), 'Path is the front page.');
}

View File

@ -61,7 +61,7 @@ class StatusTest extends BrowserTestBase {
}
// If a module is fully installed no pending updates exists.
$this->assertNoText(t('Out of date'));
$this->assertNoText('Out of date');
// The setting config_sync_directory is not properly formed.
$this->assertRaw(t("Your %file file must define the %setting setting", ['%file' => $this->siteDirectory . '/settings.php', '%setting' => "\$settings['config_sync_directory']"]));

View File

@ -310,7 +310,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
'translation' => 'untranslated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available'));
$this->assertNoText('No strings available');
$this->assertText($name, 'Search found the string as untranslated.');
// Assume this is the only result.

View File

@ -72,7 +72,7 @@ class UpdateContribTest extends UpdateTestBase {
$this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString());
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertNoText('Update available');
$this->assertText(t('No available releases found'));
$this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString());
@ -105,7 +105,7 @@ class UpdateContribTest extends UpdateTestBase {
$this->standardTests();
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertNoText('Update available');
$this->assertRaw($project_link, 'Link to aaa_update_test project appears.');
// Since aaa_update_test is installed the fact it is hidden and in the
@ -182,7 +182,7 @@ class UpdateContribTest extends UpdateTestBase {
$this->standardTests();
// We're expecting the report to say all projects are up to date.
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText('Update available');
// We want to see all 3 module names listed, since they'll show up either
// as project names or as modules under the "Includes" listing.
$this->assertText(t('AAA Update test'));
@ -393,14 +393,14 @@ class UpdateContribTest extends UpdateTestBase {
$this->refreshUpdateStatus($xml_mapping);
// In neither case should we see the "Themes" heading for installed
// themes.
$this->assertNoText(t('Themes'));
$this->assertNoText('Themes');
if ($check_disabled) {
$this->assertText(t('Uninstalled themes'));
$this->assertRaw($base_theme_project_link, 'Link to the Update test base theme project appears.');
$this->assertRaw($sub_theme_project_link, 'Link to the Update test subtheme project appears.');
}
else {
$this->assertNoText(t('Uninstalled themes'));
$this->assertNoText('Uninstalled themes');
$this->assertNoRaw($base_theme_project_link, 'Link to the Update test base theme project does not appear.');
$this->assertNoRaw($sub_theme_project_link, 'Link to the Update test subtheme project does not appear.');
}
@ -480,7 +480,7 @@ class UpdateContribTest extends UpdateTestBase {
// hope that 'Up to date' is not unique.
$this->assertNoUniqueText(t('Up to date'));
// It should say we failed to get data, not that we're missing an update.
$this->assertNoText(t('Update available'));
$this->assertNoText('Update available');
// We need to check that this string is found as part of a project row, not
// just in the "Failed to get available update data" message at the top of
@ -546,7 +546,7 @@ class UpdateContribTest extends UpdateTestBase {
$update_test_config->set('update_status', [])->save();
$this->drupalGet('admin/reports/updates');
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Security update required!'));
$this->assertNoText('Security update required!');
$this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString(), 'Link to aaa_update_test project appears.');
// Turn the altering back on and visit the Update manager UI.
@ -557,7 +557,7 @@ class UpdateContribTest extends UpdateTestBase {
// Turn the altering back off and visit the Update manager UI.
$update_test_config->set('update_status', [])->save();
$this->drupalGet('admin/modules/update');
$this->assertNoText(t('Security update'));
$this->assertNoText('Security update');
}
/**

View File

@ -86,8 +86,8 @@ class UpdateCoreTest extends UpdateTestBase {
// not be in the available updates.
$this->assertNoRaw('8.2.0');
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Security update required!'));
$this->assertNoText('Update available');
$this->assertNoText('Security update required!');
$this->assertRaw('check.svg', 'Check icon was found.');
}
}
@ -112,7 +112,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
$this->assertNoText('Security update required!');
// The XML test fixtures for this method all contain the '8.2.0' release
// but because '8.2.0' is not in a supported branch it will not be in
// the available updates.
@ -122,18 +122,18 @@ class UpdateCoreTest extends UpdateTestBase {
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$this->assertNoText(t('Up to date'));
$this->assertNoText('Up to date');
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', $full_version);
$this->assertNoText(t('Latest version:'));
$this->assertNoText('Latest version:');
$this->assertRaw('warning.svg', 'Warning icon was found.');
}
// Only unstable releases are available.
// An unstable release is the latest.
else {
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Recommended version:'));
$this->assertNoText('Update available');
$this->assertNoText('Recommended version:');
$this->assertVersionUpdateLinks('Latest version:', $full_version);
$this->assertRaw('check.svg', 'Check icon was found.');
}
@ -143,16 +143,16 @@ class UpdateCoreTest extends UpdateTestBase {
// Both stable and unstable releases are available.
// A stable release is the latest.
if ($extra_version == '') {
$this->assertNoText(t('Up to date'));
$this->assertNoText('Up to date');
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', $full_version);
$this->assertNoText(t('Latest version:'));
$this->assertNoText('Latest version:');
$this->assertRaw('warning.svg', 'Warning icon was found.');
}
// Both stable and unstable releases are available.
// An unstable release is the latest.
else {
$this->assertNoText(t('Up to date'));
$this->assertNoText('Up to date');
$this->assertText(t('Update available'));
$this->assertVersionUpdateLinks('Recommended version:', '8.1.0');
$this->assertVersionUpdateLinks('Latest version:', $full_version);
@ -177,14 +177,14 @@ class UpdateCoreTest extends UpdateTestBase {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
$this->assertNoText('Security update required!');
$this->assertRaw(Link::fromTextAndUrl('9.0.0', Url::fromUri("http://example.com/drupal-9-0-0-release"))->toString(), 'Link to release appears.');
$this->assertRaw(Link::fromTextAndUrl(t('Download'), Url::fromUri("http://example.com/drupal-9-0-0.tar.gz"))->toString(), 'Link to download appears.');
$this->assertRaw(Link::fromTextAndUrl(t('Release notes'), Url::fromUri("http://example.com/drupal-9-0-0-release"))->toString(), 'Link to release notes appears.');
$this->assertNoText(t('Up to date'));
$this->assertNoText('Up to date');
$this->assertText(t('Not supported!'));
$this->assertText(t('Recommended version:'));
$this->assertNoText(t('Latest version:'));
$this->assertNoText('Latest version:');
$this->assertRaw('error.svg', 'Error icon was found.');
}
}
@ -636,10 +636,10 @@ class UpdateCoreTest extends UpdateTestBase {
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => 'dev']);
$this->assertNoText(t('2001-Sep-'));
$this->assertNoText('2001-Sep-');
$this->assertText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertNoText(t('Security update required!'));
$this->assertNoText('Update available');
$this->assertNoText('Security update required!');
}
/**
@ -656,7 +656,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->cronRun();
$this->drupalGet('admin/modules');
$this->assertNoText(t('No update information available.'));
$this->assertNoText('No update information available.');
}
/**
@ -694,8 +694,8 @@ class UpdateCoreTest extends UpdateTestBase {
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There are updates available for your version of Drupal.');
$this->assertNoText('There is a security update available for your version of Drupal.');
}
/**
@ -717,7 +717,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertText(t('There are updates available for your version of Drupal.'));
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
}
/**
@ -738,12 +738,12 @@ class UpdateCoreTest extends UpdateTestBase {
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertNoText('There are updates available for your version of Drupal.');
$this->assertText(t('There is a security update available for your version of Drupal.'));
// Make sure admin/appearance warns you you're missing a security update.
$this->drupalGet('admin/appearance');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
$this->assertNoText('There are updates available for your version of Drupal.');
$this->assertText(t('There is a security update available for your version of Drupal.'));
// Make sure duplicate messages don't appear on Update status pages.
@ -755,10 +755,10 @@ class UpdateCoreTest extends UpdateTestBase {
$this->assertNoRaw('<li>' . t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/reports/updates/settings');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
}
/**

View File

@ -108,7 +108,7 @@ abstract class UpdateTestBase extends BrowserTestBase {
protected function standardTests() {
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString(), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
$this->assertNoText('No available releases found');
}
/**

View File

@ -175,25 +175,25 @@ class UpdateUploadTest extends UpdateTestBase {
// about core missing a security update.
$this->drupalGet('admin/modules/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/modules/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/appearance/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/appearance/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/reports/updates/install');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/reports/updates/update');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
$this->drupalGet('admin/update/ready');
$this->assertNoText(t('There is a security update available for your version of Drupal.'));
$this->assertNoText('There is a security update available for your version of Drupal.');
}
/**

View File

@ -77,7 +77,7 @@ class UserBlocksTest extends BrowserTestBase {
$edit['name'] = $user->getAccountName();
$edit['pass'] = $user->passRaw;
$this->drupalPostForm('admin/people/permissions', $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertNoText('User login', 'Logged in.');
// Check that we are still on the same page.
$this->assertUrl(Url::fromRoute('user.admin_permissions'));
@ -87,7 +87,7 @@ class UserBlocksTest extends BrowserTestBase {
$this->drupalGet('filter/tips');
$this->assertEqual('MISS', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
$this->drupalPostForm(NULL, $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertNoText('User login', 'Logged in.');
// Verify that we are still on the same page after login for allowed page.
$this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
@ -96,7 +96,7 @@ class UserBlocksTest extends BrowserTestBase {
$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->assertNoText('User login', 'Logged in.');
// Verify that we are still on the same page after login for allowed page.
$this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
$this->assertStringContainsString('/filter/tips?foo=bar', $this->getUrl(), 'Correct query arguments are displayed after login');
@ -106,7 +106,7 @@ class UserBlocksTest extends BrowserTestBase {
$this->drupalGet('filter/tips', ['query' => ['foo' => 'baz']]);
$this->assertEqual('HIT', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER));
$this->drupalPostForm(NULL, $edit, t('Log in'));
$this->assertNoText(t('User login'), 'Logged in.');
$this->assertNoText('User login', 'Logged in.');
// Verify that we are still on the same page after login for allowed page.
$this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
$this->assertStringContainsString('/filter/tips?foo=baz', $this->getUrl(), 'Correct query arguments are displayed after login');
@ -127,7 +127,7 @@ class UserBlocksTest extends BrowserTestBase {
$this->drupalPostForm('filter/tips', $edit, t('Log in'));
$this->assertText(t('Unrecognized username or password. Forgot your password?'));
$this->drupalGet('filter/tips');
$this->assertNoText(t('Unrecognized username or password. Forgot your password?'));
$this->assertNoText('Unrecognized username or password. Forgot your password?');
}
}

View File

@ -187,7 +187,7 @@ class UserCancelTest extends BrowserTestBase {
$this->drupalPostForm(NULL, NULL, t('Cancel account'));
$this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
$this->assertText(t('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your username.'), 'Informs that all content will be remain as is.');
$this->assertNoText(t('Select the method to cancel the account above.'), 'Does not allow user to select account cancellation method.');
$this->assertNoText('Select the method to cancel the account above.', 'Does not allow user to select account cancellation method.');
// Confirm account cancellation.
$timestamp = time();

View File

@ -44,7 +44,7 @@ class UserCreateFailMailTest extends BrowserTestBase {
$this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
$this->assertText(t('Unable to send email. Contact the site administrator if the problem persists.'));
$this->assertNoText(t('A welcome message with further instructions has been emailed to the new user @name.', ['@name' => $edit['name']]));
$this->assertNoText('A welcome message with further instructions has been emailed to the new user ' . $edit['name'] . '.');
}
}

View File

@ -375,7 +375,7 @@ class UserPasswordResetTest extends BrowserTestBase {
*/
public function assertValidPasswordReset($name) {
// Make sure the error text is not displayed and email sent.
$this->assertNoText(t('Sorry, @name is not recognized as a username or an e-mail address.', ['@name' => $name]), 'Validation error message shown when trying to request password for invalid account.');
$this->assertNoText("Sorry, $name is not recognized as a username or an e-mail address.", 'Validation error message shown when trying to request password for invalid account.');
$this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.');
$subject = t('Replacement login information for @username at @site', ['@username' => $this->account->getAccountName(), '@site' => \Drupal::config('system.site')->get('name')]);
$this->assertMail('subject', $subject, 'Password reset e-mail subject is correct.');
@ -401,7 +401,7 @@ class UserPasswordResetTest extends BrowserTestBase {
* Makes assertions about a password reset not triggering user flood control.
*/
public function assertNoPasswordUserFlood() {
$this->assertNoText(t('Too many password recovery requests for this account. It is temporarily blocked. Try again later or contact the site administrator.'), 'User password reset flood error message not shown.');
$this->assertNoText('Too many password recovery requests for this account. It is temporarily blocked. Try again later or contact the site administrator.', 'User password reset flood error message not shown.');
}
/**
@ -415,7 +415,7 @@ class UserPasswordResetTest extends BrowserTestBase {
* Makes assertions about a password reset not triggering IP flood control.
*/
public function assertNoPasswordIpFlood() {
$this->assertNoText(t('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.'), 'IP password reset flood error message not shown.');
$this->assertNoText('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.', 'IP password reset flood error message not shown.');
}
/**

View File

@ -97,10 +97,10 @@ class UserRoleAdminTest extends BrowserTestBase {
// interface.
$this->drupalGet('admin/people/roles/manage/' . RoleInterface::ANONYMOUS_ID);
$this->assertSession()->statusCodeEquals(200);
$this->assertNoText(t('Delete role'), 'Delete button for the anonymous role is not present.');
$this->assertNoText('Delete role', 'Delete button for the anonymous role is not present.');
$this->drupalGet('admin/people/roles/manage/' . RoleInterface::AUTHENTICATED_ID);
$this->assertSession()->statusCodeEquals(200);
$this->assertNoText(t('Delete role'), 'Delete button for the authenticated role is not present.');
$this->assertNoText('Delete role', 'Delete button for the authenticated role is not present.');
}
/**

View File

@ -39,9 +39,9 @@ class UserFieldsAccessChangeTest extends UserTestBase {
$this->assertText(t('Created'));
// User does not by default have access to init, mail and status.
$this->assertNoText(t('Init'));
$this->assertNoText(t('Email'));
$this->assertNoText(t('Status'));
$this->assertNoText('Init');
$this->assertNoText('Email');
$this->assertNoText('Status');
// Assign sub-admin role to grant extra access.
$user = $this->drupalCreateUser(['sub-admin']);

View File

@ -132,7 +132,7 @@ class DisplayCRUDTest extends UITestBase {
$this->assertLinkByHref($path_prefix . '/block_1', 0, 'Make sure after duplicating the new display appears in the UI');
$this->assertUrl($path_prefix . '/block_1');
$this->assertText(t('Block settings'));
$this->assertNoText(t('Page settings'));
$this->assertNoText('Page settings');
$this->drupalPostForm(NULL, [], t('Save'));
$view = Views::getView($view['id']);

View File

@ -64,7 +64,7 @@ class StyleUITest extends UITestBase {
$this->drupalPostForm("admin/structure/views/view/$view_name/edit", [], 'Add Page');
$this->drupalPostForm("admin/structure/views/nojs/display/$view_name/page_1/row", ['row[type]' => 'fields'], t('Apply'));
// If fields are being used this text will not be shown.
$this->assertNoText(t('The selected style or row format does not use fields.'));
$this->assertNoText('The selected style or row format does not use fields.');
}
}