diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/modules/system/src/Tests/File/DirectoryTest.php index bbb7f15..fdfc361 100644 --- a/core/modules/system/src/Tests/File/DirectoryTest.php +++ b/core/modules/system/src/Tests/File/DirectoryTest.php @@ -166,17 +166,12 @@ function testFileDirectoryTemp() { * Tests that symlinks are supported within the files directory. */ function testFileDirectorySymlinks() { - // Temporarily unset the file_temporary_path variable. - $file_temporary_path = variable_get('file_temporary_path', NULL); - variable_del('file_temporary_path'); - // Now the return value of file_directory_temp() should be outside + // The return value of file_directory_temp() should be outside // the public files directory. $temp = file_directory_temp(); - // Restore the file_temporary_path variable. - variable_set('file_temporary_path', $file_temporary_path); $public = drupal_realpath('public://'); - $dirname = $this->randomname(20); - $filename = $this->randomname(20); + $dirname = $this->randomMachineName(20); + $filename = $this->randomMachineName(20); // Create a randomly-named directory in the temp folder. $temp_dir = drupal_realpath($temp) . DIRECTORY_SEPARATOR . $dirname; drupal_mkdir($temp_dir); @@ -185,13 +180,13 @@ function testFileDirectorySymlinks() { $symlink = $public . DIRECTORY_SEPARATOR . $dirname; symlink($temp_dir, $symlink); // Copy a test file to the symlinked directory. - $source = current($this->drupalGetTestFiles('text'))->uri; + $source = 'core/misc/druplicon.png'; $destination = "public://$dirname/$filename"; file_unmanaged_copy($source, $destination, FILE_EXISTS_ERROR); // Test that the real path of the copied file lies in the temp folder. $realpath = drupal_realpath($destination); $compare = $temp_dir . DIRECTORY_SEPARATOR . $filename; - $this->assertEqual($realpath, $compare, "drupal_realpath('$destination') returned '$realpath'; expected '$compare'"); + $this->assertEqual($realpath, $compare, "drupal_realpath('$destination') returned '$realpath'; expected '$compare'."); // Clean up the mess. file_unmanaged_delete($destination); drupal_unlink($symlink);