From 53e211196671986cb4bf79b57f975bf119bd271a Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 5 Sep 2011 11:52:13 -0700 Subject: Issue #1222576 by jox: Fixed file_usage_list() is defective (might return incomplete results). --- modules/simpletest/tests/file.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test index a84208c28..3633bae11 100644 --- a/modules/simpletest/tests/file.test +++ b/modules/simpletest/tests/file.test @@ -1563,7 +1563,7 @@ class FileDeleteTest extends FileHookTestCase { file_usage_delete($file, 'testing', 'test', 1); file_delete($file); $usage = file_usage_list($file); - $this->assertEqual($usage['testing']['test'], array('id' => 1, 'count' => 1), t('Test file is still in use.')); + $this->assertEqual($usage['testing']['test'], array(1 => 1), t('Test file is still in use.')); $this->assertTrue(file_exists($file->uri), t('File still exists on the disk.')); $this->assertTrue(file_load($file->fid), t('File still exists in the database.')); @@ -2066,10 +2066,10 @@ class FileUsageTest extends FileTestCase { $usage = file_usage_list($file); $this->assertEqual(count($usage['testing']), 2, t('Returned the correct number of items.')); - $this->assertEqual($usage['testing']['foo']['id'], 1, t('Returned the correct id.')); - $this->assertEqual($usage['testing']['bar']['id'], 2, t('Returned the correct id.')); - $this->assertEqual($usage['testing']['foo']['count'], 1, t('Returned the correct count.')); - $this->assertEqual($usage['testing']['bar']['count'], 2, t('Returned the correct count.')); + $this->assertTrue(isset($usage['testing']['foo'][1]), t('Returned the correct id.')); + $this->assertTrue(isset($usage['testing']['bar'][2]), t('Returned the correct id.')); + $this->assertEqual($usage['testing']['foo'][1], 1, t('Returned the correct count.')); + $this->assertEqual($usage['testing']['bar'][2], 2, t('Returned the correct count.')); } /** -- cgit v1.2.3