Skip to content

Commit

Permalink
MDL-70964 lang: Use the fixed strings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Feb 25, 2021
1 parent 422e70e commit 0c9eaef
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Expand Up @@ -156,7 +156,7 @@ Feature: Set up contextual data for tests
And I log in as "user5"
And I should see "You are logged in as"
And I am on "Course 1" course homepage
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."

Scenario: Add modules
Given the following "courses" exist:
Expand Down
4 changes: 2 additions & 2 deletions course/tests/behat/course_browsing.feature
Expand Up @@ -79,7 +79,7 @@ Feature: Restricting access to course lists
And I should not see "Humanities"
And I should not see "Other category"
And I follow "English Y2"
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."
And I log out

Scenario: Browse courses as a user who has access to several but not all categories
Expand All @@ -102,5 +102,5 @@ Feature: Restricting access to course lists
And the "Course categories" select box should contain "English category"
And the "Course categories" select box should not contain "Other category"
And I follow "Biology Y1"
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."
And I log out
2 changes: 1 addition & 1 deletion enrol/self/tests/behat/self_enrolment.feature
Expand Up @@ -62,7 +62,7 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
Scenario: Self-enrolment disabled
Given I log in as "student1"
When I am on "Course 1" course homepage
Then I should see "You can not enrol yourself in this course"
Then I should see "You cannot enrol yourself in this course"

Scenario: Self-enrolment enabled requiring a group enrolment key
Given I log in as "teacher1"
Expand Down
2 changes: 1 addition & 1 deletion lib/filestorage/file_exceptions.php
Expand Up @@ -46,7 +46,7 @@ function __construct($errorcode, $a=NULL, $debuginfo = NULL) {
}

/**
* Can not create file exception.
* Cannot create file exception.
*
* @package core_files
* @category files
Expand Down
6 changes: 3 additions & 3 deletions lib/filestorage/tests/file_storage_test.php
Expand Up @@ -324,7 +324,7 @@ public function test_file_renaming() {

// Try break it.
$this->expectException('file_exception');
$this->expectExceptionMessage('Can not create file "1/core/unittest/0/test/newtest.txt" (file exists, cannot rename)');
$this->expectExceptionMessage('Cannot create file 1/core/unittest/0/test/newtest.txt (file exists, cannot rename)');
// This shall throw exception.
$originalfile->rename($newpath, $newname);
}
Expand Down Expand Up @@ -1478,7 +1478,7 @@ public function test_create_file_from_storedfile_duplicate() {

// Creating a file validating unique constraint.
$this->expectException(stored_file_creation_exception::class);
$this->expectExceptionMessage('Can not create file "1/core/phpunit/0/testfile.txt"');
$this->expectExceptionMessage('Cannot create file 1/core/phpunit/0/testfile.txt');
$fs->create_file_from_storedfile($filerecord, $file1->get_id());
}

Expand Down Expand Up @@ -1835,7 +1835,7 @@ public function test_create_file_from_pathname_duplicate_file() {

// Creating a file validating unique constraint.
$this->expectException(stored_file_creation_exception::class);
$this->expectExceptionMessage('Can not create file "1/core/phpunit/0/testfile.txt"');
$this->expectExceptionMessage('Cannot create file 1/core/phpunit/0/testfile.txt');
$file2 = $fs->create_file_from_pathname($filerecord, $path);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/filestorage/tests/file_system_filedir_test.php
Expand Up @@ -154,7 +154,7 @@ public function test_readonly_filesystem_filedir() {
// This should generate an exception.
$this->expectException('file_exception');
$this->expectExceptionMessageMatches(
'/Can not create local file pool directories, please verify permissions in dataroot./');
'/Cannot create local file pool directories. Please verify permissions in dataroot./');

new file_system_filedir();
}
Expand All @@ -178,7 +178,7 @@ public function test_readonly_filesystem_trashdir() {
// This should generate an exception.
$this->expectException('file_exception');
$this->expectExceptionMessageMatches(
'/Can not create local file pool directories, please verify permissions in dataroot./');
'/Cannot create local file pool directories. Please verify permissions in dataroot./');

new file_system_filedir();
}
Expand Down Expand Up @@ -835,7 +835,7 @@ public function test_add_file_from_path_existing_cannot_write_hashpath() {

$this->expectException('file_exception');
$this->expectExceptionMessageMatches(
"/Can not create local file pool directories, please verify permissions in dataroot./");
"/Cannot create local file pool directories. Please verify permissions in dataroot./");

// Attempt to add the file to the file pool.
$fs = new file_system_filedir();
Expand Down Expand Up @@ -893,7 +893,7 @@ public function test_add_file_from_string_existing_cannot_write_hashpath() {

$this->expectException('file_exception');
$this->expectExceptionMessageMatches(
"/Can not create local file pool directories, please verify permissions in dataroot./");
"/Cannot create local file pool directories. Please verify permissions in dataroot./");

// Attempt to add the file to the file pool.
$fs = new file_system_filedir();
Expand Down

0 comments on commit 0c9eaef

Please sign in to comment.