From ad3ade768153a655bde7843fed3d649eb41a0377 Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Sun, 1 Jun 2014 09:14:37 +0200 Subject: [PATCH] MDL-29708 Fixed extra slashes in $string['storedfilenotcreated']. --- lang/en/error.php | 2 +- lib/filestorage/tests/file_storage_test.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lang/en/error.php b/lang/en/error.php index b5c1c3c7fb0..7bef32afe7a 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -489,7 +489,7 @@ $string['statsnodata'] = 'There is no available data for that combination of cou $string['storedfilecannotcreatefile'] = 'Can not create local file pool file, please verify permissions in dataroot and available disk space.'; $string['storedfilecannotcreatefiledirs'] = 'Can not create local file pool directories, please verify permissions in dataroot.'; $string['storedfilecannotread'] = 'Can not read file, either file does not exist or there are permission problems'; -$string['storedfilenotcreated'] = 'Can not create file "{$a->contextid}/{$a->component}/{$a->filearea}/{$a->itemid}/{$a->filepath}/{$a->filename}"'; +$string['storedfilenotcreated'] = 'Can not create file "{$a->contextid}/{$a->component}/{$a->filearea}/{$a->itemid}{$a->filepath}{$a->filename}"'; $string['storedfileproblem'] = 'Unknown exception related to local files ({$a})'; $string['tagdisabled'] = 'Tags are disabled!'; $string['tagnotfound'] = 'The specified tag was not found in the database'; diff --git a/lib/filestorage/tests/file_storage_test.php b/lib/filestorage/tests/file_storage_test.php index abd8c1de7ea..9c7ff1dfec7 100644 --- a/lib/filestorage/tests/file_storage_test.php +++ b/lib/filestorage/tests/file_storage_test.php @@ -300,7 +300,8 @@ class core_files_file_storage_testcase extends advanced_testcase { $this->assertEquals($contenthash, $file->get_contenthash()); // Try break it. - $this->setExpectedException('file_exception'); + $this->setExpectedException('file_exception', + 'Can not create file "1/core/unittest/0/test/newtest.txt" (file exists, cannot rename)'); // This shall throw exception. $originalfile->rename($newpath, $newname); } @@ -1146,7 +1147,7 @@ class core_files_file_storage_testcase extends advanced_testcase { $this->assertInstanceOf('stored_file', $file1); // Creating a file validating unique constraint. - $this->setExpectedException('stored_file_creation_exception'); + $this->setExpectedException('stored_file_creation_exception', 'Can not create file "1/core/phpunit/0/testfile.txt"'); $fs->create_file_from_storedfile($filerecord, $file1->get_id()); } @@ -1426,7 +1427,7 @@ class core_files_file_storage_testcase extends advanced_testcase { $this->assertInstanceOf('stored_file', $file1); // Creating a file validating unique constraint. - $this->setExpectedException('stored_file_creation_exception'); + $this->setExpectedException('stored_file_creation_exception', 'Can not create file "1/core/phpunit/0/testfile.txt"'); $file2 = $fs->create_file_from_pathname($filerecord, $path); }