diff options
author | Sem <sembrestels@riseup.net> | 2012-01-12 16:15:16 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-01-12 16:15:16 +0100 |
commit | cc544cfa2086e418318a899ffd550adfb744c7ba (patch) | |
tree | 6c04fbe2e3df67513aa76803cb8d05c105ba219b /engine/tests/api/annotations.php | |
parent | e7d64510ebd823f186282e2b80780295bcca1b79 (diff) | |
parent | 68e4829ac0959d86c651e7ed6dc255c39694c8af (diff) | |
download | elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.gz elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.bz2 |
Merge Elgg 1.8.3.
Diffstat (limited to 'engine/tests/api/annotations.php')
-rw-r--r-- | engine/tests/api/annotations.php | 24 |
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()); + } } |