diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-29 20:59:57 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-29 20:59:57 +0000 |
commit | 428a7565a4046aa73e262c9a13650b7887310104 (patch) | |
tree | 909228ad84b0e02357fa4edcfb62ec03201e918d | |
parent | 3186c42a2ebb473143304a8212c6d1b230f9632b (diff) | |
download | elgg-428a7565a4046aa73e262c9a13650b7887310104.tar.gz elgg-428a7565a4046aa73e262c9a13650b7887310104.tar.bz2 |
Updating unit test to reflect deprecated functions.
git-svn-id: http://code.elgg.org/elgg/trunk@3601 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/tests/objects/metadata.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engine/tests/objects/metadata.php b/engine/tests/objects/metadata.php index cf39a186b..2728a5add 100644 --- a/engine/tests/objects/metadata.php +++ b/engine/tests/objects/metadata.php @@ -50,7 +50,7 @@ class ElggCoreMetadataTest extends ElggCoreUnitTest { $this->delete_metastrings(); } - public function testGetEntitiesFromMetadata() { + public function testElggGetEntitiesFromMetadata() { global $CONFIG, $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; $METASTRINGS_CACHE = $METASTRINGS_DEADNAME_CACHE = array(); @@ -62,16 +62,23 @@ class ElggCoreMetadataTest extends ElggCoreUnitTest { $this->assertTrue(create_metadata($this->object->guid, 'metaUnitTest', 'tested')); // check value with improper case - $this->assertFalse(get_entities_from_metadata('metaUnitTest', 'Tested', '', '', 0, 10, 0, '', 0, FALSE, TRUE)); + $options = array('names' => 'metaUnitTest', 'values' => 'Tested', 'limit' => 10, 'case_sensitive' => TRUE); + $this->assertFalse(elgg_get_entities_from_metadata($options)); // compare forced case with ignored case - $case_true = get_entities_from_metadata('metaUnitTest', 'tested', '', '', 0, 10, 0, '', 0, FALSE, TRUE); + $options = array('names' => 'metaUnitTest', 'values' => 'tested', 'limit' => 10, 'case_sensitive' => TRUE); + $case_true = elgg_get_entities_from_metadata($options); $this->assertIsA($case_true, 'array'); - $case_false = get_entities_from_metadata('metaUnitTest', 'Tested', '', '', 0, 10, 0, '', 0, FALSE, FALSE); + $options = array('names' => 'metaUnitTest', 'values' => 'Tested', 'limit' => 10, 'case_sensitive' => FALSE); + $case_false = elgg_get_entities_from_metadata($options); $this->assertIsA($case_false, 'array'); $this->assertIdentical($case_true, $case_false); + + // check deprecated get_entities_from_metadata() function + $deprecated = get_entities_from_metadata('metaUnitTest', 'tested', '', '', 0, 10, 0, '', 0, FALSE, TRUE); + $this->assertIdentical($deprecated, $case_true); // check entity list //$this->dump(list_entities_from_metadata('metaUnitTest', 'Tested', '', '', 0, 10, TRUE, TRUE, TRUE, FALSE)); |