You are here

public function MultifieldFileUsageTestCase::assertFileUsage in Multifield 7

Same name and namespace in other branches
  1. 7.2 tests/MultifieldFileUsageTestCase.test \MultifieldFileUsageTestCase::assertFileUsage()
1 call to MultifieldFileUsageTestCase::assertFileUsage()
MultifieldFileUsageTestCase::testFileUsage in tests/MultifieldFileUsageTestCase.test

File

tests/MultifieldFileUsageTestCase.test, line 137

Class

MultifieldFileUsageTestCase

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}.");
}