Skip to content

Commit

Permalink
MDL-76739 lang: Use the fixed strings in the tests, too
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz authored and junpataleta committed Jan 12, 2023
1 parent 975a127 commit 50ba9dc
Show file tree
Hide file tree
Showing 30 changed files with 120 additions and 120 deletions.
6 changes: 3 additions & 3 deletions admin/tests/behat/browse_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: An administrator can browse user accounts
When I navigate to "Users > Accounts > Browse list of users" in site administration
# Name field always present, email field is default for showidentity.
Then the following should exist in the "users" table:
| First name / Surname | Email address |
| First name / Last name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
# Should not see other identity fields or non-default name fields.
Expand All @@ -34,7 +34,7 @@ Feature: An administrator can browse user accounts
| alternativefullnameformat | firstnamephonetic lastname |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "users" table:
| First name - phonetic / Surname | Email address |
| First name - phonetic / Last name | Email address |
| Yewzer One | one@example.com |
| Yoozare Two | two@example.com |

Expand All @@ -43,7 +43,7 @@ Feature: An administrator can browse user accounts
| showuseridentity | department,profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "users" table:
| First name / Surname | Favourite frog | Department |
| First name / Last name | Favourite frog | Department |
| User One | Kermit | Attack |
| User Two | Tree | Defence |
And I should not see "Email address" in the "table" "css_element"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: Allowing multiple accounts to have the same email address
And I set the following fields to these values:
| Username | s2 |
| First name | Jane |
| Surname | Doe |
| Last name | Doe |
| Email address | <email> |
| New password | test |
And I press "Create user"
Expand Down
12 changes: 6 additions & 6 deletions admin/tests/behat/filter_users_settings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: An administrator can configure the available user list filters
When I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should not see "Username" in the "New filter" "fieldset"
And I should not see "Email address" in the "New filter" "fieldset"
Expand All @@ -30,7 +30,7 @@ Feature: An administrator can configure the available user list filters
And I should not see "MNet ID provider" in the "New filter" "fieldset"
And I navigate to "Users > Accounts > Bulk user actions" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should not see "Username" in the "New filter" "fieldset"
And I should not see "Email address" in the "New filter" "fieldset"
Expand All @@ -57,7 +57,7 @@ Feature: An administrator can configure the available user list filters
And I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should see "Username" in the "New filter" "fieldset"
And I should see "Email address" in the "New filter" "fieldset"
Expand All @@ -79,7 +79,7 @@ Feature: An administrator can configure the available user list filters
And I should not see "MNet ID provider" in the "New filter" "fieldset"
And I navigate to "Users > Accounts > Bulk user actions" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should see "Username" in the "New filter" "fieldset"
And I should see "Email address" in the "New filter" "fieldset"
Expand All @@ -106,7 +106,7 @@ Feature: An administrator can configure the available user list filters
And I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should not see "Username" in the "New filter" "fieldset"
And I should not see "Email address" in the "New filter" "fieldset"
Expand All @@ -128,7 +128,7 @@ Feature: An administrator can configure the available user list filters
And I should not see "MNet ID provider" in the "New filter" "fieldset"
And I navigate to "Users > Accounts > Bulk user actions" in site administration
Then I should see "User full name"
And I should not see "Surname" in the "New filter" "fieldset"
And I should not see "Last name" in the "New filter" "fieldset"
And I should not see "Firstname" in the "New filter" "fieldset"
And I should not see "Username" in the "New filter" "fieldset"
And I should not see "Email address" in the "New filter" "fieldset"
Expand Down
14 changes: 7 additions & 7 deletions admin/tool/behat/tests/behat/nasty_strings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ Feature: Transform steps arguments
And I open my profile in edit mode

Scenario: Use nasty strings on steps arguments
When I set the field "Surname" to "$NASTYSTRING1"
When I set the field "Last name" to "$NASTYSTRING1"
And I set the field "Description" to "$NASTYSTRING2"
And I set the field "City/town" to "$NASTYSTRING3"
And I press "Update profile"
And I click on "Edit profile" "link" in the "region-main" "region"
Then I should not see "NASTYSTRING"
And the field "Surname" matches value "$NASTYSTRING1"
And the field "Last name" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"

Scenario: Use nasty strings on table nodes
When I set the following fields to these values:
| Surname | $NASTYSTRING1 |
| Last name | $NASTYSTRING1 |
| Description | $NASTYSTRING2 |
| City/town | $NASTYSTRING3 |
And I press "Update profile"
And I click on "Edit profile" "link" in the "region-main" "region"
Then I should not see "NASTYSTRING"
And the field "Surname" matches value "$NASTYSTRING1"
And the field "Last name" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"

Scenario: Use double quotes
Expand All @@ -48,11 +48,11 @@ Feature: Transform steps arguments
Scenario: Nasty strings with other contents
When I set the field "First name" to "My Firstname $NASTYSTRING1"
And I set the following fields to these values:
| Surname | My Surname $NASTYSTRING2 |
| Last name | My Last name $NASTYSTRING2 |
And I press "Update profile"
And I click on "Edit profile" "link" in the "region-main" "region"
Then I should not see "NASTYSTRING"
And I should see "My Firstname"
And I should see "My Surname"
And I should see "My Last name"
And the field "First name" matches value "My Firstname $NASTYSTRING1"
And the field "Surname" matches value "My Surname $NASTYSTRING2"
And the field "Last name" matches value "My Last name $NASTYSTRING2"
18 changes: 9 additions & 9 deletions admin/tool/policy/tests/behat/consent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -53,7 +53,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -98,7 +98,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -157,7 +157,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -210,7 +210,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -522,7 +522,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
When I press "Create my new account"
Then I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -647,7 +647,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -716,7 +716,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -858,7 +858,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/policy/tests/behat/optional.feature
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Feature: Optional policies
| Email address | user3@address.invalid |
| Email (again) | user3@address.invalid |
| First name | User3 |
| Surname | L3 |
| Last name | L3 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down
6 changes: 3 additions & 3 deletions auth/email/tests/behat/signup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: User must accept policy when logging in and signing up
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
And I press "Create my new account"
And I should see "Confirm your account"
And I should see "An email should have been sent to your address at [email protected]"
Expand Down Expand Up @@ -48,7 +48,7 @@ Feature: User must accept policy when logging in and signing up
| Email address | user1@address.invalid |
| Email (again) | user1@address.invalid |
| First name | User1 |
| Surname | L1 |
| Last name | L1 |
| I understand and agree | 1 |
And I press "Create my new account"
And I should see "Confirm your account"
Expand Down Expand Up @@ -81,7 +81,7 @@ Feature: User must accept policy when logging in and signing up
| Email address | <email1> |
| Email (again) | <email2> |
| First name | Jane |
| Surname | Doe |
| Last name | Doe |
And I press "Create my new account"
Then I should <expect> "This email address is already registered. Perhaps you created an account in the past?"
And I should <expect2> "Invalid email address"
Expand Down
14 changes: 7 additions & 7 deletions cohort/tests/behat/reportbuilder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ Feature: Manage custom reports for cohorts
| My report | user:lastname |
And I change window size to "large"
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
And I set the field "Rename column 'Surname'" to "Member count"
And I set the "Surname" column aggregation to "Count"
And I set the field "Rename column 'Last name'" to "Member count"
And I set the "Last name" column aggregation to "Count"
And I click on "Show/hide 'Sorting'" "button"
And I click on "Move sorting for column 'Surname'" "button"
And I click on "To the top of the list" "link" in the "Move sorting for column 'Surname'" "dialogue"
And I click on "Enable sorting for column 'Surname'" "checkbox"
And I click on "Move sorting for column 'Last name'" "button"
And I click on "To the top of the list" "link" in the "Move sorting for column 'Last name'" "dialogue"
And I click on "Enable initial sorting for column Last name" "checkbox"
# "New system cohort" has fewer members than "Another one" cohort.
And "New system cohort" "table_row" should appear before "Another one" "table_row"
When I click on "Sort column 'Surname' descending" "button"
Then I should see "Updated sorting for column 'Surname'"
When I click on "Sort column 'Last name' descending" "button"
Then I should see "Updated sorting for column 'Last name'"
# Switching sort direction should now show "Another one" cohort ahead of "New system cohort".
And "Another one" "table_row" should appear before "New system cohort" "table_row"
8 changes: 4 additions & 4 deletions grade/import/csv/tests/load_data_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
class load_data_test extends \grade_base_testcase {

/** @var string $oktext Text to be imported. This data should have no issues being imported. */
protected $oktext = '"First name",Surname,"ID number",Institution,Department,"Email address","Assignment: Assignment for grape group", "Feedback: Assignment for grape group","Assignment: Second new grade item","Course total"
protected $oktext = '"First name","Last name","ID number",Institution,Department,"Email address","Assignment: Assignment for grape group", "Feedback: Assignment for grape group","Assignment: Second new grade item","Course total"
Anne,Able,,"Moodle HQ","Rock on!",[email protected],56.00,"We welcome feedback",,56.00
Bobby,Bunce,,"Moodle HQ","Rock on!",[email protected],75.00,,45.0,75.00';

/** @var string $badtext Text to be imported. This data has an extra column and should not succeed in being imported. */
protected $badtext = '"First name",Surname,"ID number",Institution,Department,"Email address","Assignment: Assignment for grape group","Course total"
protected $badtext = '"First name","Last name","ID number",Institution,Department,"Email address","Assignment: Assignment for grape group","Course total"
Anne,Able,,"Moodle HQ","Rock on!",[email protected],56.00,56.00,78.00
Bobby,Bunce,,"Moodle HQ","Rock on!",[email protected],75.00,75.00';

/** @var string $csvtext CSV data to be imported with Last download from this course column. */
protected $csvtext = '"First name",Surname,"ID number",Institution,Department,"Email address","Assignment: Assignment for grape group", "Feedback: Assignment for grape group","Course total","Last downloaded from this course"
protected $csvtext = '"First name","Last name","ID number",Institution,Department,"Email address","Assignment: Assignment for grape group", "Feedback: Assignment for grape group","Course total","Last downloaded from this course"
Anne,Able,,"Moodle HQ","Rock on!",[email protected],56.00,"We welcome feedback",56.00,{exportdate}
Bobby,Bunce,,"Moodle HQ","Rock on!",[email protected],75.00,,75.00,{exportdate}';

Expand Down Expand Up @@ -121,7 +121,7 @@ public function test_load_csv_content() {

$expectedheaders = array(
'First name',
'Surname',
'Last name',
'ID number',
'Institution',
'Department',
Expand Down
Loading

0 comments on commit 50ba9dc

Please sign in to comment.