diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-04-16 08:48:26 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-04-16 08:48:26 -0400 |
commit | 9c57079db65491cb4e9fb439c4d886507a50c31e (patch) | |
tree | 0a4af16446de3384f13f07e03982e926f397e900 /modules/file/tests | |
parent | 38b29900520db43f3b8b6c2ec138679e0a5c53cf (diff) | |
download | brdo-9c57079db65491cb4e9fb439c4d886507a50c31e.tar.gz brdo-9c57079db65491cb4e9fb439c4d886507a50c31e.tar.bz2 |
- Patch #984456 by Dave Reid, bfroehle: cleanup file_field_widget_uri() and its token replacement.
Diffstat (limited to 'modules/file/tests')
-rw-r--r-- | modules/file/tests/file.test | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test index 99f95b42f..ea8c5c67b 100644 --- a/modules/file/tests/file.test +++ b/modules/file/tests/file.test @@ -932,7 +932,7 @@ class FileFieldPathTestCase extends FileFieldTestCase { // Check the path when used with tokens. // Change the path to contain multiple token directories. - $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[user:uid]/[user:name]')); + $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[current-user:uid]/[current-user:name]')); // Upload a new file into the token subdirectories. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); @@ -940,6 +940,8 @@ class FileFieldPathTestCase extends FileFieldTestCase { // Check that the file was uploaded into the subdirectory. $node = node_load($nid, NULL, TRUE); $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; + // Do token replacement using the same user which uploaded the file, not + // the user running the test case. $data = array('user' => $this->admin_user); $subdirectory = token_replace('[user:uid]/[user:name]', $data); $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->uri))); |