public function MultifieldFileUsageTestCase::assertFileUsage in Multifield 7.2
Same name and namespace in other branches
- 7 tests/MultifieldFileUsageTestCase.test \MultifieldFileUsageTestCase::assertFileUsage()
1 call to MultifieldFileUsageTestCase::assertFileUsage()
File
- tests/
MultifieldFileUsageTestCase.test, line 103
Class
Code
public function assertFileUsage($file, $module, $type, $id, $count) {
$usage = file_usage_list($file);
$actual_count = isset($usage[$module][$type][$id]) ? $usage[$module][$type][$id] : 0;
return $this
->assertEqual($actual_count, $count, "File usage for fid {$file->fid} on {$module}:{$type}:{$id} is {$actual_count}, expected {$count}.");
}