diff options
Diffstat (limited to 'engine/tests/api/metadata.php')
-rw-r--r-- | engine/tests/api/metadata.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engine/tests/api/metadata.php b/engine/tests/api/metadata.php index f5b615ca8..be8ac269c 100644 --- a/engine/tests/api/metadata.php +++ b/engine/tests/api/metadata.php @@ -99,6 +99,31 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { $this->object->delete(); } + public function testElggDeleteMetadata() { + $e = new ElggObject(); + $e->save(); + + for ($i=0; $i<30; $i++) { + $name = "test_metadata" . rand(0, 10000); + $e->$name = rand(0, 10000); + } + + $options = array( + 'guid' => $e->getGUID(), + 'limit' => 0 + ); + + $md = elgg_get_metadata($options); + $this->assertIdentical(30, count($md)); + + $this->assertTrue(elgg_delete_metadata($options)); + + $md = elgg_get_metadata($options); + $this->assertTrue(empty($md)); + + $e->delete(); + } + protected function create_metastring($string) { global $CONFIG, $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; |