function FileFieldPathsTestCase::checkFileName in File (Field) Paths 6
Same name and namespace in other branches
- 6.2 tests/filefield_paths.test \FileFieldPathsTestCase::checkFileName()
2 calls to FileFieldPathsTestCase::checkFileName()
- FileFieldPathsUploadTestCase::testUploadFile in tests/
filefield_paths.test - Test file upload.
- filefield_paths.test in tests/
filefield_paths.test - This file implements tests for FileField Paths.
File
- tests/
filefield_paths.test, line 55 - This file implements tests for FileField Paths.
Class
- FileFieldPathsTestCase
- @file This file implements tests for FileField Paths.
Code
function checkFileName($file, $node, $retroactive = FALSE) {
$origfile = pathinfo($file['origname']);
$filename = $node->title . '.' . $origfile['extension'];
$message = t('Make sure filename has been processed.');
if ($retroactive) {
$filename = 'retroactive-' . $filename;
$message = t('Make sure filename has been retroactively processed.');
}
$this
->assertEqual($file['filename'], $filename, $message, 'FileField Paths');
}