Revert "Issue #2060405 by Wim Leers: Fixed Impossible to uninstall any module...
Revert "Issue #2060405 by Wim Leers: Fixed Impossible to uninstall any module using the file usage service, because it is impossible to delete all file usages by a module."
This reverts commit 858674f0.
Changes for core/modules/file/lib/Drupal/file/Tests/UsageTest.php: 0 added lines, 38 removed lines.
Original line number
Diff line number
Diff line
@@ -52,44 +52,6 @@ function testGetUsage() {
$this->assertEqual($usage['testing']['bar'][2],2,'Returned the correct count.');
}
/**
* Tests file_usage()->deleteByModule().
*/
functiontestDeleteByModule(){
$file=$this->createFile();
db_insert('file_usage')
->fields(array(
'fid'=>$file->id(),
'module'=>'testing',
'type'=>'foo',
'id'=>1,
'count'=>1
))
->execute();
db_insert('file_usage')
->fields(array(
'fid'=>$file->id(),
'module'=>'testing',
'type'=>'bar',
'id'=>2,
'count'=>2
))
->execute();
db_insert('file_usage')
->fields(array(
'fid'=>$file->id(),
'module'=>'file',
'type'=>'bar',
'id'=>2,
'count'=>2
))
->execute();
file_usage()->deleteByModule('testing');
$this->assertIdentical(array('file'=>array('bar'=>array(2=>'2'))),file_usage()->listUsage($file),'All records for the "testing" module have been deleted.');