Commit 7465e9ba authored by xjm's avatar xjm
Browse files

Issue #3143339 by mohrerao, mondrake, longwave: Clean up the arguments of...

Issue #3143339 by mohrerao, mondrake, longwave: Clean up the arguments of calls to WebAssert::titleEquals() and AssertLegacyTrait::assertTitle()

(cherry picked from commit e4e64fa0)
parent 95bc6694
......@@ -41,7 +41,7 @@ protected function assertBreadcrumb($goto, array $trail, $page_title = NULL, arr
// Additionally assert page title, if given.
if (isset($page_title)) {
$this->assertTitle(strtr('@title | Drupal', ['@title' => $page_title]));
$this->assertTitle("$page_title | Drupal");
}
// Additionally assert active trail in a menu tree output, if given.
......
......@@ -60,7 +60,7 @@ public function testUninstallPage() {
$node->save();
$this->drupalGet('admin/modules/uninstall');
$this->assertTitle(t('Uninstall') . ' | Drupal');
$this->assertTitle('Uninstall | Drupal');
foreach (\Drupal::service('extension.list.module')->getAllInstalledInfo() as $module => $info) {
$field_name = "uninstall[$module]";
......@@ -136,7 +136,7 @@ public function testUninstallPage() {
// Make sure confirmation page is accessible only during uninstall process.
$this->drupalGet('admin/modules/uninstall/confirm');
$this->assertUrl('admin/modules/uninstall');
$this->assertTitle(t('Uninstall') . ' | Drupal');
$this->assertTitle('Uninstall | Drupal');
// Make sure the correct error is shown when no modules are selected.
$edit = [];
......
......@@ -51,7 +51,7 @@ public function drupalGetAuthorizePHP($page_title = 'system-test-auth') {
public function testFileTransferHooks() {
$page_title = $this->randomMachineName(16);
$this->drupalGetAuthorizePHP($page_title);
$this->assertTitle(strtr('@title | Drupal', ['@title' => $page_title]), 'authorize.php page title is correct.');
$this->assertTitle("$page_title | Drupal");
$this->assertNoText('It appears you have reached this page in error.');
$this->assertText('To continue, provide your server connection details');
// Make sure we see the new connection method added by system_test.
......
......@@ -81,7 +81,7 @@ public function testVocabularyInterface() {
$this->drupalPostForm('admin/structure/taxonomy/add', $edit, t('Save'));
$site_name = $this->config('system.site')->get('name');
$this->assertTitle(t("Don't Panic | @site-name", ['@site-name' => $site_name]), 'The page title contains the escaped character.');
$this->assertTitle("Don't Panic | $site_name");
}
/**
......
......@@ -212,7 +212,7 @@ public function testTrackerUser() {
$this->assertNoLink($unpublished->label());
// Verify that title and tab title have been set correctly.
$this->assertText('Activity', 'The user activity tab has the name "Activity".');
$this->assertTitle(t('@name | @site', ['@name' => $this->user->getAccountName(), '@site' => $this->config('system.site')->get('name')]), 'The user tracker page has the correct page title.');
$this->assertTitle($this->user->getAccountName() . ' | Drupal');
// Verify that unpublished comments are removed from the tracker.
$admin_user = $this->drupalCreateUser(['post comments', 'administer comments', 'access user profiles']);
......
......@@ -120,16 +120,16 @@ public function testAccountPageTitles() {
$title_suffix = ' | Drupal';
$this->drupalGet('user');
$this->assertTitle('Log in' . $title_suffix, "Page title of /user is 'Log in'");
$this->assertTitle('Log in' . $title_suffix);
$this->drupalGet('user/login');
$this->assertTitle('Log in' . $title_suffix, "Page title of /user/login is 'Log in'");
$this->assertTitle('Log in' . $title_suffix);
$this->drupalGet('user/register');
$this->assertTitle('Create new account' . $title_suffix, "Page title of /user/register is 'Create new account' for anonymous users.");
$this->assertTitle('Create new account' . $title_suffix);
$this->drupalGet('user/password');
$this->assertTitle('Reset your password' . $title_suffix, "Page title of /user/register is 'Reset your password' for anonymous users.");
$this->assertTitle('Reset your password' . $title_suffix);
// Check the page title for registered users is "My Account" in menus.
$this->drupalLogin($this->drupalCreateUser());
......
......@@ -105,12 +105,12 @@ public function testUserPasswordReset() {
// Check the one-time login page.
$this->assertText($this->account->getAccountName(), 'One-time login page contains the correct username.');
$this->assertText(t('This login can be used only once.'), 'Found warning about one-time login.');
$this->assertTitle(t('Reset password | Drupal'), 'Page title is "Reset password".');
$this->assertTitle('Reset password | Drupal');
// Check successful login.
$this->drupalPostForm(NULL, NULL, t('Log in'));
$this->assertLink(t('Log out'));
$this->assertTitle(t('@name | @site', ['@name' => $this->account->getAccountName(), '@site' => $this->config('system.site')->get('name')]), 'Logged in using password reset link.');
$this->assertTitle($this->account->getAccountName() . ' | Drupal');
// Change the forgotten password.
$password = user_password();
......@@ -189,7 +189,7 @@ public function testUserPasswordReset() {
$reset_url = $this->getResetURL();
$this->drupalGet($reset_url . '/login');
$this->assertLink(t('Log out'));
$this->assertTitle(t('@name | @site', ['@name' => $this->account->getAccountName(), '@site' => $this->config('system.site')->get('name')]), 'Logged in using password reset link.');
$this->assertTitle($this->account->getAccountName() . ' | Drupal');
// Ensure blocked and deleted accounts can't access the user.reset.login
// route.
......@@ -359,7 +359,7 @@ public function testUserResetPasswordUserFloodControlIsCleared() {
$reset_url = $this->getResetURL();
$this->drupalGet($reset_url . '/login');
$this->assertLink(t('Log out'));
$this->assertTitle(t('@name | @site', ['@name' => $this->account->getAccountName(), '@site' => $this->config('system.site')->get('name')]), 'Logged in using password reset link.');
$this->assertTitle($this->account->getAccountName() . ' | Drupal');
$this->drupalLogout();
// The next request should *not* trigger flood control, since a successful
......
......@@ -55,7 +55,7 @@ public function testRegistrationWithEmailVerification() {
$this->assertTrue($new_user->isActive(), 'New account is active after registration.');
$resetURL = user_pass_reset_url($new_user);
$this->drupalGet($resetURL);
$this->assertTitle(t('Set password | Drupal'), 'Page title is "Set password".');
$this->assertTitle('Set password | Drupal');
// Allow registration by site visitors, but require administrator approval.
$config->set('register', UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
......
......@@ -99,7 +99,7 @@ public function testPageDisplayMenu() {
':a_class' => 'is-active',
]);
$this->assertEqual($element[0]->getText(), t('Test default tab'));
$this->assertTitle(t('Test default page | Drupal'));
$this->assertTitle('Test default page | Drupal');
$this->drupalGet('test_page_display_menu/default');
$this->assertSession()->statusCodeEquals(404);
......@@ -111,7 +111,7 @@ public function testPageDisplayMenu() {
':a_class' => 'is-active',
]);
$this->assertEqual($element[0]->getText(), t('Test local tab'));
$this->assertTitle(t('Test local page | Drupal'));
$this->assertTitle('Test local page | Drupal');
// Check an ordinary menu link.
$admin_user = $this->drupalCreateUser(['administer menu']);
......
......@@ -93,7 +93,7 @@ public function testDefaultViews() {
$edit = [
'id' => 'duplicate_of_glossary',
];
$this->assertTitle(t('Duplicate of @label | @site-name', ['@label' => 'Glossary', '@site-name' => $this->config('system.site')->get('name')]));
$this->assertTitle('Duplicate of Glossary | Drupal');
$this->drupalPostForm(NULL, $edit, t('Duplicate'));
$this->assertUrl('admin/structure/views/view/duplicate_of_glossary', [], 'The normal duplicating name schema is applied.');
......
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