diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
index 75890943694463844d565b6ed910d4501cc0616c..ef3a1d57529bfb9adecf9ae213faf8454aeeeb6c 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
@@ -39,14 +39,14 @@ function testUserAdmin() {
$admin_user = $this->drupalCreateUser(array('administer users'));
$this->drupalLogin($admin_user);
$this->drupalGet('admin/people');
- $this->assertText($user_a->name, t('Found user A on admin users page'));
- $this->assertText($user_b->name, t('Found user B on admin users page'));
- $this->assertText($user_c->name, t('Found user C on admin users page'));
- $this->assertText($admin_user->name, t('Found Admin user on admin users page'));
+ $this->assertText($user_a->name, 'Found user A on admin users page');
+ $this->assertText($user_b->name, 'Found user B on admin users page');
+ $this->assertText($user_c->name, 'Found user C on admin users page');
+ $this->assertText($admin_user->name, 'Found Admin user on admin users page');
// Test for existence of edit link in table.
$link = l(t('edit'), "user/$user_a->uid/edit", array('query' => array('destination' => 'admin/people')));
- $this->assertRaw($link, t('Found user A edit link on admin users page'));
+ $this->assertRaw($link, 'Found user A edit link on admin users page');
// Filter the users by permission 'administer taxonomy'.
$edit = array();
@@ -54,9 +54,9 @@ function testUserAdmin() {
$this->drupalPost('admin/people', $edit, t('Filter'));
// Check if the correct users show up.
- $this->assertNoText($user_a->name, t('User A not on filtered by perm admin users page'));
- $this->assertText($user_b->name, t('Found user B on filtered by perm admin users page'));
- $this->assertText($user_c->name, t('Found user C on filtered by perm admin users page'));
+ $this->assertNoText($user_a->name, 'User A not on filtered by perm admin users page');
+ $this->assertText($user_b->name, 'Found user B on filtered by perm admin users page');
+ $this->assertText($user_c->name, 'Found user C on filtered by perm admin users page');
// Filter the users by role. Grab the system-generated role name for User C.
$roles = $user_c->roles;
@@ -65,9 +65,9 @@ function testUserAdmin() {
$this->drupalPost('admin/people', $edit, t('Refine'));
// Check if the correct users show up when filtered by role.
- $this->assertNoText($user_a->name, t('User A not on filtered by role on admin users page'));
- $this->assertNoText($user_b->name, t('User B not on filtered by role on admin users page'));
- $this->assertText($user_c->name, t('User C on filtered by role on admin users page'));
+ $this->assertNoText($user_a->name, 'User A not on filtered by role on admin users page');
+ $this->assertNoText($user_b->name, 'User B not on filtered by role on admin users page');
+ $this->assertText($user_c->name, 'User C on filtered by role on admin users page');
// Test blocking of a user.
$account = user_load($user_c->uid);
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAuthmapAssignmentTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAuthmapAssignmentTest.php
index 332c5636d98b271eb631d235914dbb6ea26764c9..92cc54c9d108a35db2def4442caa8603e0bbd8ae 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAuthmapAssignmentTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAuthmapAssignmentTest.php
@@ -15,9 +15,9 @@
class UserAuthmapAssignmentTest extends WebTestBase {
public static function getInfo() {
return array(
- 'name' => t('Authmap assignment'),
- 'description' => t('Tests that users can be assigned and unassigned authmaps.'),
- 'group' => t('User')
+ 'name' => 'Authmap assignment',
+ 'description' => 'Tests that users can be assigned and unassigned authmaps.',
+ 'group' => 'User'
);
}
@@ -44,7 +44,7 @@ function testAuthmapAssignment() {
),
);
foreach ($expected_authmaps as $authname => $expected_output) {
- $this->assertIdentical(user_get_authmaps($authname), $expected_output, t('Authmap for authname %authname was set correctly.', array('%authname' => $authname)));
+ $this->assertIdentical(user_get_authmaps($authname), $expected_output, format_string('Authmap for authname %authname was set correctly.', array('%authname' => $authname)));
}
// Remove authmap for module poll, add authmap for module blog.
@@ -57,13 +57,13 @@ function testAuthmapAssignment() {
// Assert that external username one does not have authmaps.
$remove_username = 'external username one';
unset($expected_authmaps[$remove_username]);
- $this->assertFalse(user_get_authmaps($remove_username), t('Authmap for %authname was removed.', array('%authname' => $remove_username)));
+ $this->assertFalse(user_get_authmaps($remove_username), format_string('Authmap for %authname was removed.', array('%authname' => $remove_username)));
// Assert that a new authmap was created for external username three, and
// existing authmaps for external username two were unchanged.
$expected_authmaps['external username three'] = array('blog' => 'external username three');
foreach ($expected_authmaps as $authname => $expected_output) {
- $this->assertIdentical(user_get_authmaps($authname), $expected_output, t('Authmap for authname %authname was set correctly.', array('%authname' => $authname)));
+ $this->assertIdentical(user_get_authmaps($authname), $expected_output, format_string('Authmap for authname %authname was set correctly.', array('%authname' => $authname)));
}
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
index d5f1d8afafd02372ebaab105d156228eb65514ac..8f058f3ad753f3ba183c04547f9cce35f4e48d59 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
@@ -36,15 +36,15 @@ function testUserAutocomplete() {
// Check access from unprivileged user, should be denied.
$this->drupalLogin($this->unprivileged_user);
$this->drupalGet('user/autocomplete/' . $this->unprivileged_user->name[0]);
- $this->assertResponse(403, t('Autocompletion access denied to user without permission.'));
+ $this->assertResponse(403, 'Autocompletion access denied to user without permission.');
// Check access from privileged user.
$this->drupalLogout();
$this->drupalLogin($this->privileged_user);
$this->drupalGet('user/autocomplete/' . $this->unprivileged_user->name[0]);
- $this->assertResponse(200, t('Autocompletion access allowed.'));
+ $this->assertResponse(200, 'Autocompletion access allowed.');
// Using first letter of the user's name, make sure the user's full name is in the results.
- $this->assertRaw($this->unprivileged_user->name, t('User name found in autocompletion results.'));
+ $this->assertRaw($this->unprivileged_user->name, 'User name found in autocompletion results.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
index 79503cf5475ec2bb166f8fabdd5a261bff486075..07c71e87b0d408db804e3f1a5f9963ebf7f5da74 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
@@ -61,23 +61,23 @@ function testUserLoginBlock() {
$edit['name'] = $user->name;
$edit['pass'] = $user->pass_raw;
$this->drupalPost('admin/people/permissions', $edit, t('Log in'));
- $this->assertNoText(t('User login'), t('Logged in.'));
+ $this->assertNoText(t('User login'), 'Logged in.');
// Check that we are still on the same page.
- $this->assertEqual(url('admin/people/permissions', array('absolute' => TRUE)), $this->getUrl(), t('Still on the same page after login for access denied page'));
+ $this->assertEqual(url('admin/people/permissions', array('absolute' => TRUE)), $this->getUrl(), 'Still on the same page after login for access denied page');
// Now, log out and repeat with a non-403 page.
$this->drupalLogout();
$this->drupalPost('filter/tips', $edit, t('Log in'));
- $this->assertNoText(t('User login'), t('Logged in.'));
- $this->assertPattern('!
!', t('Still on the same page after login for allowed page'));
+ $this->assertNoText(t('User login'), 'Logged in.');
+ $this->assertPattern('!!', 'Still on the same page after login for allowed page');
// Check that the user login block is not vulnerable to information
// disclosure to third party sites.
$this->drupalLogout();
$this->drupalPost('http://example.com/', $edit, t('Log in'), array('external' => FALSE));
// Check that we remain on the site after login.
- $this->assertEqual(url('user/' . $user->uid, array('absolute' => TRUE)), $this->getUrl(), t('Redirected to user profile page after login from the frontpage'));
+ $this->assertEqual(url('user/' . $user->uid, array('absolute' => TRUE)), $this->getUrl(), 'Redirected to user profile page after login from the frontpage');
}
/**
@@ -88,12 +88,12 @@ function testWhosOnlineBlock() {
$user1 = $this->drupalCreateUser(array());
$user2 = $this->drupalCreateUser(array());
$user3 = $this->drupalCreateUser(array());
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions}")->fetchField(), 0, t('Sessions table is empty.'));
+ $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions}")->fetchField(), 0, 'Sessions table is empty.');
// Insert a user with two sessions.
$this->insertSession(array('uid' => $user1->uid));
$this->insertSession(array('uid' => $user1->uid));
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions} WHERE uid = :uid", array(':uid' => $user1->uid))->fetchField(), 2, t('Duplicate user session has been inserted.'));
+ $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions} WHERE uid = :uid", array(':uid' => $user1->uid))->fetchField(), 2, 'Duplicate user session has been inserted.');
// Insert a user with only one session.
$this->insertSession(array('uid' => $user2->uid, 'timestamp' => REQUEST_TIME + 1));
@@ -109,11 +109,11 @@ function testWhosOnlineBlock() {
$block = user_block_view('online');
$block['content'] = render($block['content']);
$this->drupalSetContent($block['content']);
- $this->assertRaw(t('2 users'), t('Correct number of online users (2 users).'));
- $this->assertText($user1->name, t('Active user 1 found in online list.'));
- $this->assertText($user2->name, t('Active user 2 found in online list.'));
- $this->assertNoText($user3->name, t("Inactive user not found in online list."));
- $this->assertTrue(strpos($this->drupalGetContent(), $user1->name) > strpos($this->drupalGetContent(), $user2->name), t('Online users are ordered correctly.'));
+ $this->assertRaw(t('2 users'), 'Correct number of online users (2 users).');
+ $this->assertText($user1->name, 'Active user 1 found in online list.');
+ $this->assertText($user2->name, 'Active user 2 found in online list.');
+ $this->assertNoText($user3->name, 'Inactive user not found in online list.');
+ $this->assertTrue(strpos($this->drupalGetContent(), $user1->name) > strpos($this->drupalGetContent(), $user2->name), 'Online users are ordered correctly.');
}
/**
@@ -129,6 +129,6 @@ private function insertSession(array $fields = array()) {
db_insert('sessions')
->fields($fields)
->execute();
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions} WHERE uid = :uid AND sid = :sid AND timestamp = :timestamp", array(':uid' => $fields['uid'], ':sid' => $fields['sid'], ':timestamp' => $fields['timestamp']))->fetchField(), 1, t('Session record inserted.'));
+ $this->assertEqual(db_query("SELECT COUNT(*) FROM {sessions} WHERE uid = :uid AND sid = :sid AND timestamp = :timestamp", array(':uid' => $fields['uid'], ':sid' => $fields['sid'], ':timestamp' => $fields['timestamp']))->fetchField(), 1, 'Session record inserted.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
index 0d12cff00f48d41fedc260e66b7030bdca7b8eda..8b51fe0994fc4f68e838bc0e20a4eaacc6f31044 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
@@ -48,18 +48,18 @@ function testUserCancelWithoutPermission() {
// Attempt to cancel account.
$this->drupalGet('user/' . $account->uid . '/edit');
- $this->assertNoRaw(t('Cancel account'), t('No cancel account button displayed.'));
+ $this->assertNoRaw(t('Cancel account'), 'No cancel account button displayed.');
// Attempt bogus account cancellation request confirmation.
$timestamp = $account->login;
$this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
- $this->assertResponse(403, t('Bogus cancelling request rejected.'));
+ $this->assertResponse(403, 'Bogus cancelling request rejected.');
$account = user_load($account->uid);
- $this->assertTrue($account->status == 1, t('User account was not canceled.'));
+ $this->assertTrue($account->status == 1, 'User account was not canceled.');
// Confirm user's content has not been altered.
$test_node = node_load($node->nid, TRUE);
- $this->assertTrue(($test_node->uid == $account->uid && $test_node->status == 1), t('Node of the user has not been altered.'));
+ $this->assertTrue(($test_node->uid == $account->uid && $test_node->status == 1), 'Node of the user has not been altered.');
}
/**
@@ -98,7 +98,7 @@ function testUserCancelUid1() {
// Verify that uid 1's account was not cancelled.
$user1 = user_load(1, TRUE);
- $this->assertEqual($user1->status, 1, t('User #1 still exists and is not blocked.'));
+ $this->assertEqual($user1->status, 1, 'User #1 still exists and is not blocked.');
}
/**
@@ -122,25 +122,25 @@ function testUserCancelInvalid() {
// Confirm account cancellation.
$timestamp = time();
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
// Attempt bogus account cancellation request confirmation.
$bogus_timestamp = $timestamp + 60;
$this->drupalGet("user/$account->uid/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
- $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), t('Bogus cancelling request rejected.'));
+ $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), 'Bogus cancelling request rejected.');
$account = user_load($account->uid);
- $this->assertTrue($account->status == 1, t('User account was not canceled.'));
+ $this->assertTrue($account->status == 1, 'User account was not canceled.');
// Attempt expired account cancellation request confirmation.
$bogus_timestamp = $timestamp - 86400 - 60;
$this->drupalGet("user/$account->uid/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
- $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), t('Expired cancel account request rejected.'));
+ $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), 'Expired cancel account request rejected.');
$account = user_load($account->uid, TRUE);
- $this->assertTrue($account->status, t('User account was not canceled.'));
+ $this->assertTrue($account->status, 'User account was not canceled.');
// Confirm user's content has not been altered.
$test_node = node_load($node->nid, TRUE);
- $this->assertTrue(($test_node->uid == $account->uid && $test_node->status == 1), t('Node of the user has not been altered.'));
+ $this->assertTrue(($test_node->uid == $account->uid && $test_node->status == 1), 'Node of the user has not been altered.');
}
/**
@@ -159,23 +159,23 @@ function testUserBlock() {
// Attempt to cancel account.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('Are you sure you want to cancel your account?'), t('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 user name.'), t('Informs that all content will be remain as is.'));
- $this->assertNoText(t('Select the method to cancel the account above.'), t('Does not allow user to select account cancellation method.'));
+ $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 user name.'), '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.');
// Confirm account cancellation.
$timestamp = time();
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
// Confirm account cancellation request.
$this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
$account = user_load($account->uid, TRUE);
- $this->assertTrue($account->status == 0, t('User has been blocked.'));
+ $this->assertTrue($account->status == 0, 'User has been blocked.');
// Confirm user is logged out.
- $this->assertNoText($account->name, t('Logged out.'));
+ $this->assertNoText($account->name, 'Logged out.');
}
/**
@@ -199,27 +199,27 @@ function testUserBlockUnpublish() {
// Attempt to cancel account.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('Are you sure you want to cancel your account?'), t('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 be hidden from everyone but administrators.'), t('Informs that all content will be unpublished.'));
+ $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 be hidden from everyone but administrators.'), 'Informs that all content will be unpublished.');
// Confirm account cancellation.
$timestamp = time();
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
// Confirm account cancellation request.
$this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
$account = user_load($account->uid, TRUE);
- $this->assertTrue($account->status == 0, t('User has been blocked.'));
+ $this->assertTrue($account->status == 0, 'User has been blocked.');
// Confirm user's content has been unpublished.
$test_node = node_load($node->nid, TRUE);
- $this->assertTrue($test_node->status == 0, t('Node of the user has been unpublished.'));
+ $this->assertTrue($test_node->status == 0, 'Node of the user has been unpublished.');
$test_node = node_revision_load($node->vid);
- $this->assertTrue($test_node->status == 0, t('Node revision of the user has been unpublished.'));
+ $this->assertTrue($test_node->status == 0, 'Node revision of the user has been unpublished.');
// Confirm user is logged out.
- $this->assertNoText($account->name, t('Logged out.'));
+ $this->assertNoText($account->name, 'Logged out.');
}
/**
@@ -249,28 +249,28 @@ function testUserAnonymize() {
// Attempt to cancel account.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('Are you sure you want to cancel your account?'), t('Confirmation form to cancel account displayed.'));
- $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => config('user.settings')->get('anonymous'))), t('Informs that all content will be attributed to anonymous account.'));
+ $this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
+ $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.');
// Confirm account cancellation.
$timestamp = time();
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
// Confirm account cancellation request.
$this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
- $this->assertFalse(user_load($account->uid, TRUE), t('User is not found in the database.'));
+ $this->assertFalse(user_load($account->uid, TRUE), 'User is not found in the database.');
// Confirm that user's content has been attributed to anonymous user.
$test_node = node_load($node->nid, TRUE);
- $this->assertTrue(($test_node->uid == 0 && $test_node->status == 1), t('Node of the user has been attributed to anonymous user.'));
+ $this->assertTrue(($test_node->uid == 0 && $test_node->status == 1), 'Node of the user has been attributed to anonymous user.');
$test_node = node_revision_load($revision, TRUE);
- $this->assertTrue(($test_node->revision_uid == 0 && $test_node->status == 1), t('Node revision of the user has been attributed to anonymous user.'));
+ $this->assertTrue(($test_node->revision_uid == 0 && $test_node->status == 1), 'Node revision of the user has been attributed to anonymous user.');
$test_node = node_load($revision_node->nid, TRUE);
- $this->assertTrue(($test_node->uid != 0 && $test_node->status == 1), t("Current revision of the user's node was not attributed to anonymous user."));
+ $this->assertTrue(($test_node->uid != 0 && $test_node->status == 1), "Current revision of the user's node was not attributed to anonymous user.");
// Confirm that user is logged out.
- $this->assertNoText($account->name, t('Logged out.'));
+ $this->assertNoText($account->name, 'Logged out.');
}
/**
@@ -299,7 +299,7 @@ function testUserDelete() {
$this->assertText(t('Your comment has been posted.'));
$comments = entity_load_multiple_by_properties('comment', array('subject' => $edit['subject']));
$comment = reset($comments);
- $this->assertTrue($comment->cid, t('Comment found.'));
+ $this->assertTrue($comment->cid, 'Comment found.');
// Create a node with two revisions, the initial one belonging to the
// cancelling user.
@@ -313,26 +313,26 @@ function testUserDelete() {
// Attempt to cancel account.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('Are you sure you want to cancel your account?'), t('Confirmation form to cancel account displayed.'));
- $this->assertText(t('Your account will be removed and all account information deleted. All of your content will also be deleted.'), t('Informs that all content will be deleted.'));
+ $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 removed and all account information deleted. All of your content will also be deleted.'), 'Informs that all content will be deleted.');
// Confirm account cancellation.
$timestamp = time();
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
// Confirm account cancellation request.
$this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
- $this->assertFalse(user_load($account->uid, TRUE), t('User is not found in the database.'));
+ $this->assertFalse(user_load($account->uid, TRUE), 'User is not found in the database.');
// Confirm that user's content has been deleted.
- $this->assertFalse(node_load($node->nid, TRUE), t('Node of the user has been deleted.'));
- $this->assertFalse(node_revision_load($revision), t('Node revision of the user has been deleted.'));
- $this->assertTrue(node_load($revision_node->nid, TRUE), t("Current revision of the user's node was not deleted."));
- $this->assertFalse(comment_load($comment->cid), t('Comment of the user has been deleted.'));
+ $this->assertFalse(node_load($node->nid, TRUE), 'Node of the user has been deleted.');
+ $this->assertFalse(node_revision_load($revision), 'Node revision of the user has been deleted.');
+ $this->assertTrue(node_load($revision_node->nid, TRUE), "Current revision of the user's node was not deleted.");
+ $this->assertFalse(comment_load($comment->cid), 'Comment of the user has been deleted.');
// Confirm that user is logged out.
- $this->assertNoText($account->name, t('Logged out.'));
+ $this->assertNoText($account->name, 'Logged out.');
}
/**
@@ -351,13 +351,13 @@ function testUserCancelByAdmin() {
// Delete regular user.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), t('Confirmation form to cancel account displayed.'));
- $this->assertText(t('Select the method to cancel the account above.'), t('Allows to select account cancellation method.'));
+ $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), 'Confirmation form to cancel account displayed.');
+ $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
// Confirm deletion.
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), t('User deleted.'));
- $this->assertFalse(user_load($account->uid), t('User is not found in the database.'));
+ $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), 'User deleted.');
+ $this->assertFalse(user_load($account->uid), 'User is not found in the database.');
}
/**
@@ -379,13 +379,13 @@ function testUserWithoutEmailCancelByAdmin() {
// Delete regular user without e-mail address.
$this->drupalGet('user/' . $account->uid . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), t('Confirmation form to cancel account displayed.'));
- $this->assertText(t('Select the method to cancel the account above.'), t('Allows to select account cancellation method.'));
+ $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), 'Confirmation form to cancel account displayed.');
+ $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
// Confirm deletion.
$this->drupalPost(NULL, NULL, t('Cancel account'));
- $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), t('User deleted.'));
- $this->assertFalse(user_load($account->uid), t('User is not found in the database.'));
+ $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), 'User deleted.');
+ $this->assertFalse(user_load($account->uid), 'User is not found in the database.');
}
/**
@@ -417,10 +417,10 @@ function testMassUserCancelByAdmin() {
// Also try to cancel uid 1.
$edit['accounts[1]'] = TRUE;
$this->drupalPost('admin/people', $edit, t('Update'));
- $this->assertText(t('Are you sure you want to cancel these user accounts?'), t('Confirmation form to cancel accounts displayed.'));
- $this->assertText(t('When cancelling these accounts'), t('Allows to select account cancellation method.'));
- $this->assertText(t('Require e-mail confirmation to cancel account.'), t('Allows to send confirmation mail.'));
- $this->assertText(t('Notify user when account is canceled.'), t('Allows to send notification mail.'));
+ $this->assertText(t('Are you sure you want to cancel these user accounts?'), 'Confirmation form to cancel accounts displayed.');
+ $this->assertText(t('When cancelling these accounts'), 'Allows to select account cancellation method.');
+ $this->assertText(t('Require e-mail confirmation to cancel account.'), 'Allows to send confirmation mail.');
+ $this->assertText(t('Notify user when account is canceled.'), 'Allows to send notification mail.');
// Confirm deletion.
$this->drupalPost(NULL, NULL, t('Cancel accounts'));
@@ -429,15 +429,15 @@ function testMassUserCancelByAdmin() {
$status = $status && (strpos($this->content, t('%name has been deleted.', array('%name' => $account->name))) !== FALSE);
$status = $status && !user_load($account->uid, TRUE);
}
- $this->assertTrue($status, t('Users deleted and not found in the database.'));
+ $this->assertTrue($status, 'Users deleted and not found in the database.');
// Ensure that admin account was not cancelled.
- $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), t('Account cancellation request mailed message displayed.'));
+ $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
$admin_user = user_load($admin_user->uid);
- $this->assertTrue($admin_user->status == 1, t('Administrative user is found in the database and enabled.'));
+ $this->assertTrue($admin_user->status == 1, 'Administrative user is found in the database and enabled.');
// Verify that uid 1's account was not cancelled.
$user1 = user_load(1, TRUE);
- $this->assertEqual($user1->status, 1, t('User #1 still exists and is not blocked.'));
+ $this->assertEqual($user1->status, 1, 'User #1 still exists and is not blocked.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
index 6bf60bc4a1426b3ca463077cfca335d8c2607e1e..ea78e033c6ed5a054afd30dfbe58e4d57f93f1df 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
@@ -47,12 +47,12 @@ function testUserEdit() {
$edit['pass[pass1]'] = '';
$edit['pass[pass2]'] = $this->randomName();
$this->drupalPost("user/$user1->uid/edit", $edit, t('Save'));
- $this->assertText(t("The specified passwords do not match."), t('Typing mismatched passwords displays an error message.'));
+ $this->assertText(t("The specified passwords do not match."), 'Typing mismatched passwords displays an error message.');
$edit['pass[pass1]'] = $this->randomName();
$edit['pass[pass2]'] = '';
$this->drupalPost("user/$user1->uid/edit", $edit, t('Save'));
- $this->assertText(t("The specified passwords do not match."), t('Typing mismatched passwords displays an error message.'));
+ $this->assertText(t("The specified passwords do not match."), 'Typing mismatched passwords displays an error message.');
// Test that the error message appears when attempting to change the mail or
// pass without the current password.
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
index 13eb0061c22fd7a89baf45b179ba4de903f0962f..a4bfd522c8c36ec7f0e8311e6079b7add178628d 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
@@ -40,12 +40,12 @@ function setUp() {
* Test label callback.
*/
function testLabelCallback() {
- $this->assertEqual($this->account->label(), $this->account->name, t('The username should be used as label'));
+ $this->assertEqual($this->account->label(), $this->account->name, 'The username should be used as label');
// Setup a random anonymous name to be sure the name is used.
$name = $this->randomName();
config('user.settings')->set('anonymous', $name)->save();
- $this->assertEqual($this->anonymous->label(), $name, t('The variable anonymous should be used for name of uid 0'));
+ $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0');
}
/**
@@ -53,6 +53,6 @@ function testLabelCallback() {
*/
function testUriCallback() {
$uri = $this->account->uri();
- $this->assertEqual('user/' . $this->account->uid, $uri['path'], t('Correct user URI.'));
+ $this->assertEqual('user/' . $this->account->uid, $uri['path'], 'Correct user URI.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php
index d611b57c9a8f416c1076cf1570f5259a81ca0886..18a815c1ffd383e0ed03448c8866e5582dcef0c1 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php
@@ -48,20 +48,20 @@ function testLocalUserCreation() {
'predefined_langcode' => 'fr',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
- $this->assertText('French', t('Language added successfully.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertText('French', 'Language added successfully.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Set language negotiation.
$edit = array(
'language_interface[enabled][language-url]' => TRUE,
);
$this->drupalPost('admin/config/regional/language/detection', $edit, t('Save settings'));
- $this->assertText(t('Language negotiation configuration saved.'), t('Set language negotiation.'));
+ $this->assertText(t('Language negotiation configuration saved.'), 'Set language negotiation.');
// Check if the language selector is available on admin/people/create and
// set to the currently active language.
$this->drupalGet($langcode . '/admin/people/create');
- $this->assertOptionSelected("edit-preferred-langcode", $langcode, t('Global language set in the language selector.'));
+ $this->assertOptionSelected("edit-preferred-langcode", $langcode, 'Global language set in the language selector.');
// Create a user with the admin/people/create form and check if the correct
// language is set.
@@ -76,14 +76,14 @@ function testLocalUserCreation() {
$this->drupalPost($langcode . '/admin/people/create', $edit, t('Create new account'));
$user = user_load_by_name($username);
- $this->assertEqual($user->preferred_langcode, $langcode, t('New user has correct preferred language set.'));
- $this->assertEqual($user->langcode, $langcode, t('New user has correct profile language set.'));
+ $this->assertEqual($user->preferred_langcode, $langcode, 'New user has correct preferred language set.');
+ $this->assertEqual($user->langcode, $langcode, 'New user has correct profile language set.');
// Register a new user and check if the language selector is hidden.
$this->drupalLogout();
$this->drupalGet($langcode . '/user/register');
- $this->assertNoFieldByName('language[fr]', t('Language selector is not accessible.'));
+ $this->assertNoFieldByName('language[fr]', 'Language selector is not accessible.');
$username = $this->randomName(10);
$edit = array(
@@ -94,8 +94,8 @@ function testLocalUserCreation() {
$this->drupalPost($langcode . '/user/register', $edit, t('Create new account'));
$user = user_load_by_name($username);
- $this->assertEqual($user->preferred_langcode, $langcode, t('New user has correct preferred language set.'));
- $this->assertEqual($user->langcode, $langcode, t('New user has correct profile language set.'));
+ $this->assertEqual($user->preferred_langcode, $langcode, 'New user has correct preferred language set.');
+ $this->assertEqual($user->langcode, $langcode, 'New user has correct profile language set.');
// Test if the admin can use the language selector and if the
// correct language is was saved.
@@ -103,7 +103,7 @@ function testLocalUserCreation() {
$this->drupalLogin($admin_user);
$this->drupalGet($user_edit);
- $this->assertOptionSelected("edit-preferred-langcode", $langcode, t('Language selector is accessible and correct language is selected.'));
+ $this->assertOptionSelected("edit-preferred-langcode", $langcode, 'Language selector is accessible and correct language is selected.');
// Set pass_raw so we can login the new user.
$user->pass_raw = $this->randomName(10);
@@ -116,6 +116,6 @@ function testLocalUserCreation() {
$this->drupalLogin($user);
$this->drupalGet($user_edit);
- $this->assertOptionSelected("edit-preferred-langcode", $langcode, t('Language selector is accessible and correct language is selected.'));
+ $this->assertOptionSelected("edit-preferred-langcode", $langcode, 'Language selector is accessible and correct language is selected.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php
index f0155b69bb281bc5267351de16103b39d76235e0..7a3c7b538b10dda12cff1499b3da7faabb318781 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php
@@ -60,18 +60,18 @@ function testUserLanguageConfiguration() {
$path = 'user/' . $web_user->uid . '/edit';
$this->drupalGet($path);
// Ensure language settings fieldset is available.
- $this->assertText(t('Language'), t('Language selector available.'));
+ $this->assertText(t('Language'), 'Language selector available.');
// Ensure custom language is present.
- $this->assertText($name, t('Language present on form.'));
+ $this->assertText($name, 'Language present on form.');
// Switch to our custom language.
$edit = array(
'preferred_langcode' => $langcode,
);
$this->drupalPost($path, $edit, t('Save'));
// Ensure form was submitted successfully.
- $this->assertText(t('The changes have been saved.'), t('Changes were saved.'));
+ $this->assertText(t('The changes have been saved.'), 'Changes were saved.');
// Check if language was changed.
- $this->assertOptionSelected('edit-preferred-langcode', $langcode, t('Default language successfully updated.'));
+ $this->assertOptionSelected('edit-preferred-langcode', $langcode, 'Default language successfully updated.');
$this->drupalLogout();
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
index 43cb43cc2876f62eb875247dda30c51de357d78a..0b6eebaf99bdc1bc2790f5a0113081069f80731b 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
@@ -138,7 +138,7 @@ function assertFailedLogin($account, $flood_trigger = NULL) {
'pass' => $account->pass_raw,
);
$this->drupalPost('user', $edit, t('Log in'));
- $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, t('Password value attribute is blank.'));
+ $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, 'Password value attribute is blank.');
if (isset($flood_trigger)) {
if ($flood_trigger == 'user') {
$this->assertRaw(format_plural(config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => url('user/password'))));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
index 43f43e322f8a5992989b6d18ed53ee73834c31ca..2455b10514c5b7e75995acc25b1e0055a3aa3b6c 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
@@ -41,24 +41,24 @@ function testUserPermissionChanges() {
$account = $this->admin_user;
// Add a permission.
- $this->assertFalse(user_access('administer nodes', $account), t('User does not have "administer nodes" permission.'));
+ $this->assertFalse(user_access('administer nodes', $account), 'User does not have "administer nodes" permission.');
$edit = array();
$edit[$rid . '[administer nodes]'] = TRUE;
$this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
- $this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
+ $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.');
drupal_static_reset('user_access');
drupal_static_reset('user_role_permissions');
- $this->assertTrue(user_access('administer nodes', $account), t('User now has "administer nodes" permission.'));
+ $this->assertTrue(user_access('administer nodes', $account), 'User now has "administer nodes" permission.');
// Remove a permission.
- $this->assertTrue(user_access('access user profiles', $account), t('User has "access user profiles" permission.'));
+ $this->assertTrue(user_access('access user profiles', $account), 'User has "access user profiles" permission.');
$edit = array();
$edit[$rid . '[access user profiles]'] = FALSE;
$this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
- $this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
+ $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.');
drupal_static_reset('user_access');
drupal_static_reset('user_role_permissions');
- $this->assertFalse(user_access('access user profiles', $account), t('User no longer has "access user profiles" permission.'));
+ $this->assertFalse(user_access('access user profiles', $account), 'User no longer has "access user profiles" permission.');
}
/**
@@ -80,7 +80,7 @@ function testAdministratorRole() {
// Aggregator depends on file module, enable that as well.
$edit['modules[Core][file][enable]'] = TRUE;
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
- $this->assertTrue(user_access('administer news feeds', $this->admin_user), t('The permission was automatically assigned to the administrator role'));
+ $this->assertTrue(user_access('administer news feeds', $this->admin_user), 'The permission was automatically assigned to the administrator role');
}
/**
@@ -91,9 +91,9 @@ function testUserRoleChangePermissions() {
$account = $this->admin_user;
// Verify current permissions.
- $this->assertFalse(user_access('administer nodes', $account), t('User does not have "administer nodes" permission.'));
- $this->assertTrue(user_access('access user profiles', $account), t('User has "access user profiles" permission.'));
- $this->assertTrue(user_access('administer site configuration', $account), t('User has "administer site configuration" permission.'));
+ $this->assertFalse(user_access('administer nodes', $account), 'User does not have "administer nodes" permission.');
+ $this->assertTrue(user_access('access user profiles', $account), 'User has "access user profiles" permission.');
+ $this->assertTrue(user_access('administer site configuration', $account), 'User has "administer site configuration" permission.');
// Change permissions.
$permissions = array(
@@ -103,8 +103,8 @@ function testUserRoleChangePermissions() {
user_role_change_permissions($rid, $permissions);
// Verify proper permission changes.
- $this->assertTrue(user_access('administer nodes', $account), t('User now has "administer nodes" permission.'));
- $this->assertFalse(user_access('access user profiles', $account), t('User no longer has "access user profiles" permission.'));
- $this->assertTrue(user_access('administer site configuration', $account), t('User still has "administer site configuration" permission.'));
+ $this->assertTrue(user_access('administer nodes', $account), 'User now has "administer nodes" permission.');
+ $this->assertFalse(user_access('access user profiles', $account), 'User no longer has "access user profiles" permission.');
+ $this->assertTrue(user_access('administer site configuration', $account), 'User still has "administer site configuration" permission.');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
index ddfae72127c4990347230fbd291936f871f0f697..0413b3b0b0700fd9db5dc2ff254f348f214a49c4 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
@@ -61,7 +61,7 @@ function testNoPicture() {
// Try to upload a file that is not an image for the user picture.
$not_an_image = current($this->drupalGetTestFiles('html'));
$this->saveUserPicture($not_an_image);
- $this->assertRaw(t('Only JPEG, PNG and GIF images are allowed.'), t('Non-image files are not accepted.'));
+ $this->assertRaw(t('Only JPEG, PNG and GIF images are allowed.'), 'Non-image files are not accepted.');
}
/**
@@ -87,13 +87,13 @@ function testWithGDinvalidDimension() {
// Check that the image was resized and is being displayed on the
// user's profile page.
$text = t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $test_dim));
- $this->assertRaw($text, t('Image was resized.'));
+ $this->assertRaw($text, 'Image was resized.');
$alt = t("@user's picture", array('@user' => user_format_name($this->user)));
$style = variable_get('user_picture_style', '');
- $this->assertRaw(image_style_url($style, $pic_path), t("Image is displayed in user's edit page"));
+ $this->assertRaw(image_style_url($style, $pic_path), "Image is displayed in user's edit page");
// Check if file is located in proper directory.
- $this->assertTrue(is_file($pic_path), t("File is located in proper directory"));
+ $this->assertTrue(is_file($pic_path), 'File is located in proper directory.');
}
}
@@ -124,12 +124,12 @@ function testWithGDinvalidSize() {
// Test that the upload failed and that the correct reason was cited.
$text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename));
- $this->assertRaw($text, t('Upload failed.'));
+ $this->assertRaw($text, 'Upload failed.');
$text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->uri)), '%maxsize' => format_size($test_size * 1024)));
- $this->assertRaw($text, t('File size cited as reason for failure.'));
+ $this->assertRaw($text, 'File size cited as reason for failure.');
// Check if file is not uploaded.
- $this->assertFalse(is_file($pic_path), t('File was not uploaded.'));
+ $this->assertFalse(is_file($pic_path), 'File was not uploaded.');
}
}
@@ -156,12 +156,12 @@ function testWithoutGDinvalidDimension() {
// Test that the upload failed and that the correct reason was cited.
$text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename));
- $this->assertRaw($text, t('Upload failed.'));
+ $this->assertRaw($text, 'Upload failed.');
$text = t('The image is too large; the maximum dimensions are %dimensions pixels.', array('%dimensions' => $test_dim));
- $this->assertRaw($text, t('Checking response on invalid image (dimensions).'));
+ $this->assertRaw($text, 'Checking response on invalid image (dimensions).');
// Check if file is not uploaded.
- $this->assertFalse(is_file($pic_path), t('File was not uploaded.'));
+ $this->assertFalse(is_file($pic_path), 'File was not uploaded.');
}
}
@@ -189,12 +189,12 @@ function testWithoutGDinvalidSize() {
// Test that the upload failed and that the correct reason was cited.
$text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename));
- $this->assertRaw($text, t('Upload failed.'));
+ $this->assertRaw($text, 'Upload failed.');
$text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->uri)), '%maxsize' => format_size($test_size * 1024)));
- $this->assertRaw($text, t('File size cited as reason for failure.'));
+ $this->assertRaw($text, 'File size cited as reason for failure.');
// Check if file is not uploaded.
- $this->assertFalse(is_file($pic_path), t('File was not uploaded.'));
+ $this->assertFalse(is_file($pic_path), 'File was not uploaded.');
}
}
@@ -220,17 +220,17 @@ function testPictureIsValid() {
// Check if image is displayed in user's profile page.
$this->drupalGet('user');
- $this->assertRaw(file_uri_target($pic_path), t("Image is displayed in user's profile page"));
+ $this->assertRaw(file_uri_target($pic_path), "Image is displayed in user's profile page.");
// Check if file is located in proper directory.
- $this->assertTrue(is_file($pic_path), t('File is located in proper directory'));
+ $this->assertTrue(is_file($pic_path), 'File is located in proper directory.');
// Set new picture dimensions.
$test_dim = ($info['width'] + 5) . 'x' . ($info['height'] + 5);
variable_set('user_picture_dimensions', $test_dim);
$pic_path2 = $this->saveUserPicture($image);
- $this->assertNotEqual($pic_path, $pic_path2, t('Filename of second picture is different.'));
+ $this->assertNotEqual($pic_path, $pic_path2, 'Filename of second picture is different.');
}
}
@@ -250,8 +250,8 @@ function testExternalPicture() {
// Get the user picture image via xpath.
$elements = $this->xpath('//div[@class="user-picture"]/img');
- $this->assertEqual(count($elements), 1, t("There is exactly one user picture on the user's profile page"));
- $this->assertEqual($pic_path, (string) $elements[0]['src'], t("User picture source is correct: " . $pic_path . " " . print_r($elements, TRUE)));
+ $this->assertEqual(count($elements), 1, "There is exactly one user picture on the user's profile page.");
+ $this->assertEqual($pic_path, (string) $elements[0]['src'], format_string("User picture source is correct: %path %elements.", array('%path' => $pic_path, '%elements' => print_r($elements, TRUE))));
}
/**
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
index d89192f57dee0be5bcb0146b909a904135a6b37c..9c518d708c12436e9921cb0c1b12728cfa872357 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -34,7 +34,7 @@ function testRegistrationWithEmailVerification() {
// Set registration to administrator only.
$config->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();
$this->drupalGet('user/register');
- $this->assertResponse(403, t('Registration page is inaccessible when only administrators can create accounts.'));
+ $this->assertResponse(403, 'Registration page is inaccessible when only administrators can create accounts.');
// Allow registration by site visitors without administrator approval.
$config->set('register', USER_REGISTER_VISITORS)->save();
@@ -42,10 +42,10 @@ function testRegistrationWithEmailVerification() {
$edit['name'] = $name = $this->randomName();
$edit['mail'] = $mail = $edit['name'] . '@example.com';
$this->drupalPost('user/register', $edit, t('Create new account'));
- $this->assertText(t('A welcome message with further instructions has been sent to your e-mail address.'), t('User registered successfully.'));
+ $this->assertText(t('A welcome message with further instructions has been sent to your e-mail address.'), 'User registered successfully.');
$accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
$new_user = reset($accounts);
- $this->assertTrue($new_user->status, t('New account is active after registration.'));
+ $this->assertTrue($new_user->status, 'New account is active after registration.');
// Allow registration by site visitors, but require administrator approval.
$config->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
@@ -56,7 +56,7 @@ function testRegistrationWithEmailVerification() {
entity_get_controller('user')->resetCache();
$accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
$new_user = reset($accounts);
- $this->assertFalse($new_user->status, t('New account is blocked until approved by an administrator.'));
+ $this->assertFalse($new_user->status, 'New account is blocked until approved by an administrator.');
}
function testRegistrationWithoutEmailVerification() {
@@ -76,7 +76,7 @@ function testRegistrationWithoutEmailVerification() {
$edit['pass[pass1]'] = '99999.0';
$edit['pass[pass2]'] = '99999';
$this->drupalPost('user/register', $edit, t('Create new account'));
- $this->assertText(t('The specified passwords do not match.'), t('Typing mismatched passwords displays an error message.'));
+ $this->assertText(t('The specified passwords do not match.'), 'Typing mismatched passwords displays an error message.');
// Enter a correct password.
$edit['pass[pass1]'] = $new_pass = $this->randomName();
@@ -85,7 +85,7 @@ function testRegistrationWithoutEmailVerification() {
entity_get_controller('user')->resetCache();
$accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
$new_user = reset($accounts);
- $this->assertText(t('Registration successful. You are now logged in.'), t('Users are logged in after registering.'));
+ $this->assertText(t('Registration successful. You are now logged in.'), 'Users are logged in after registering.');
$this->drupalLogout();
// Allow registration by site visitors, but require administrator approval.
@@ -96,7 +96,7 @@ function testRegistrationWithoutEmailVerification() {
$edit['pass[pass1]'] = $pass = $this->randomName();
$edit['pass[pass2]'] = $pass;
$this->drupalPost('user/register', $edit, t('Create new account'));
- $this->assertText(t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.'), t('Users are notified of pending approval'));
+ $this->assertText(t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.'), 'Users are notified of pending approval');
// Try to login before administrator approval.
$auth = array(
@@ -104,7 +104,7 @@ function testRegistrationWithoutEmailVerification() {
'pass' => $pass,
);
$this->drupalPost('user/login', $auth, t('Log in'));
- $this->assertText(t('The username @name has not been activated or is blocked.', array('@name' => $name)), t('User cannot login yet.'));
+ $this->assertText(t('The username @name has not been activated or is blocked.', array('@name' => $name)), 'User cannot login yet.');
// Activate the new account.
$accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
@@ -119,7 +119,7 @@ function testRegistrationWithoutEmailVerification() {
// Login after administrator approval.
$this->drupalPost('user/login', $auth, t('Log in'));
- $this->assertText(t('Member for'), t('User can log in after administrator approval.'));
+ $this->assertText(t('Member for'), 'User can log in after administrator approval.');
}
function testRegistrationEmailDuplicates() {
@@ -139,13 +139,13 @@ function testRegistrationEmailDuplicates() {
// Attempt to create a new account using an existing e-mail address.
$this->drupalPost('user/register', $edit, t('Create new account'));
- $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying an exact duplicate email address displays an error message'));
+ $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), 'Supplying an exact duplicate email address displays an error message');
// Attempt to bypass duplicate email registration validation by adding spaces.
$edit['mail'] = ' ' . $duplicate_user->mail . ' ';
$this->drupalPost('user/register', $edit, t('Create new account'));
- $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying a duplicate email address with added whitespace displays an error message'));
+ $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), 'Supplying a duplicate email address with added whitespace displays an error message');
}
function testRegistrationDefaultValues() {
@@ -164,7 +164,7 @@ function testRegistrationDefaultValues() {
// Check that the account information fieldset's options are not displayed
// is a fieldset if there is not more than one fieldset in the form.
$this->drupalGet('user/register');
- $this->assertNoRaw('