diff --git a/lib/filestorage/tests/file_system_filedir_test.php b/lib/filestorage/tests/file_system_filedir_test.php index 1f65099cb9..0c12808ef9 100644 --- a/lib/filestorage/tests/file_system_filedir_test.php +++ b/lib/filestorage/tests/file_system_filedir_test.php @@ -149,8 +149,8 @@ public function test_readonly_filesystem_filedir() { ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); // This should generate an exception. - $this->setExpectedExceptionRegexp('file_exception', - '/Can not create local file pool directories, please verify permissions in dataroot./'); + $this->setExpectedException('file_exception', + 'Can not create local file pool directories, please verify permissions in dataroot.'); new file_system_filedir(); } @@ -170,8 +170,8 @@ public function test_readonly_filesystem_trashdir() { ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); // This should generate an exception. - $this->setExpectedExceptionRegexp('file_exception', - '/Can not create local file pool directories, please verify permissions in dataroot./'); + $this->setExpectedException('file_exception', + 'Can not create local file pool directories, please verify permissions in dataroot.'); new file_system_filedir(); } @@ -693,8 +693,8 @@ public function test_add_file_from_path_file_unavailable() { // Setup the filedir. $vfileroot = $this->setup_vfile_root(); - $this->setExpectedExceptionRegexp('file_exception', - '/Cannot read file\. Either the file does not exist or there is a permission problem\./'); + $this->setExpectedException('file_exception', + 'Cannot read file. Either the file does not exist or there is a permission problem.'); $fs = new file_system_filedir(); $fs->add_file_from_path(\org\bovigo\vfs\vfsStream::url('filedir/file'));