You are here

function FileFieldPathsTestCase::setFileFieldPathsSettings in File (Field) Paths 6

Same name and namespace in other branches
  1. 6.2 tests/filefield_paths.test \FileFieldPathsTestCase::setFileFieldPathsSettings()
2 calls to FileFieldPathsTestCase::setFileFieldPathsSettings()
FileFieldPathsUploadTestCase::testUploadFile in tests/filefield_paths.test
Test file upload.
FileFieldPathsUploadTestCase::testUploadFile in tests/filefield_paths.test
Test file upload.

File

tests/filefield_paths.test, line 84
This file implements tests for FileField Paths.

Class

FileFieldPathsTestCase
@file This file implements tests for FileField Paths.

Code

function setFileFieldPathsSettings($field, $edit = array(), $retroactive = FALSE) {
  $edit['ffp_' . $field . '[file_path]'] = 'node/[nid]';
  $edit['ffp_' . $field . '[file_name]'] = '[title-raw].[filefield-extension-original]';
  if ($retroactive) {
    $edit['ffp_' . $field . '[file_path]'] = 'retroactive-' . $edit['ffp_' . $field . '[file_path]'];
    $edit['ffp_' . $field . '[file_name]'] = 'retroactive-' . $edit['ffp_' . $field . '[file_name]'];
    $edit['ffp_' . $field . '[retroactive_update]'] = 1;
  }
  return $edit;
}