aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/api/annotations.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-01-10 16:54:49 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-01-10 16:54:49 -0800
commita3f0353600e749a16abbdab3cbc75b3469d6fd69 (patch)
treefc534efde38eebc2db7b9b8d5044b9943dc93db2 /engine/tests/api/annotations.php
parent0fe0f9d6dc6577d39bf0615c0e714c7fa7d2ebf3 (diff)
downloadelgg-a3f0353600e749a16abbdab3cbc75b3469d6fd69.tar.gz
elgg-a3f0353600e749a16abbdab3cbc75b3469d6fd69.tar.bz2
Fixes #4269. Not using ElggBatch to delete metadata / annotations. Added unit tests for deleting annotations/md. Fixed an annoying inconsistency with "metastring/s" option in private functions.
Diffstat (limited to 'engine/tests/api/annotations.php')
-rw-r--r--engine/tests/api/annotations.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/tests/api/annotations.php b/engine/tests/api/annotations.php
index d7551a0fa..947292970 100644
--- a/engine/tests/api/annotations.php
+++ b/engine/tests/api/annotations.php
@@ -43,4 +43,28 @@ class ElggCoreAnnotationAPITest extends ElggCoreUnitTest {
$this->object->delete();
}
+
+ public function testElggDeleteAnnotations() {
+ $e = new ElggObject();
+ $e->save();
+
+ for ($i=0; $i<30; $i++) {
+ $e->annotate('test_annotation', rand(0,10000));
+ }
+
+ $options = array(
+ 'guid' => $e->getGUID(),
+ 'limit' => 0
+ );
+
+ $annotations = elgg_get_annotations($options);
+ $this->assertIdentical(30, count($annotations));
+
+ $this->assertTrue(elgg_delete_annotations($options));
+
+ $annotations = elgg_get_annotations($options);
+ $this->assertTrue(empty($annotations));
+
+ $this->assertTrue($e->delete());
+ }
}