Check that two files have the same values for all fields other than the timestamp.
$before: File object to compare.
$after: File object to compare.
function assertFileUnchanged($before, $after) {
$this
->assertEqual($before->fid, $after->fid, t('File id is the same: %file1 == %file2.', array(
'%file1' => $before->fid,
'%file2' => $after->fid,
)), 'File unchanged');
$this
->assertEqual($before->uid, $after->uid, t('File owner is the same: %file1 == %file2.', array(
'%file1' => $before->uid,
'%file2' => $after->uid,
)), 'File unchanged');
$this
->assertEqual($before->filename, $after->filename, t('File name is the same: %file1 == %file2.', array(
'%file1' => $before->filename,
'%file2' => $after->filename,
)), 'File unchanged');
$this
->assertEqual($before->uri, $after->uri, t('File path is the same: %file1 == %file2.', array(
'%file1' => $before->uri,
'%file2' => $after->uri,
)), 'File unchanged');
$this
->assertEqual($before->filemime, $after->filemime, t('File MIME type is the same: %file1 == %file2.', array(
'%file1' => $before->filemime,
'%file2' => $after->filemime,
)), 'File unchanged');
$this
->assertEqual($before->filesize, $after->filesize, t('File size is the same: %file1 == %file2.', array(
'%file1' => $before->filesize,
'%file2' => $after->filesize,
)), 'File unchanged');
$this
->assertEqual($before->status, $after->status, t('File status is the same: %file1 == %file2.', array(
'%file1' => $before->status,
'%file2' => $after->status,
)), 'File unchanged');
}