summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-09-05 11:52:13 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-09-05 11:52:13 -0700
commit53e211196671986cb4bf79b57f975bf119bd271a (patch)
tree9af19c8d9788790c415b89c62cc8160abf97d722 /modules/simpletest/tests
parent73b7dae00657c93fedf26398849eaf79d1d2c5c3 (diff)
downloadbrdo-53e211196671986cb4bf79b57f975bf119bd271a.tar.gz
brdo-53e211196671986cb4bf79b57f975bf119bd271a.tar.bz2
Issue #1222576 by jox: Fixed file_usage_list() is defective (might return incomplete results).
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/file.test10
1 files changed, 5 insertions, 5 deletions
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.'));
}
/**