From 237caef7b9358b08e75145a6c4fec53ad04cb7b1 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 1 Mar 2010 16:21:36 +0000 Subject: Fixes #1558: Applied Cash's patch. Added unit tests to test for regressions for any bugs fixed in trac. git-svn-id: http://code.elgg.org/elgg/trunk@3979 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/tests/regression/trac_bugs.php | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 engine/tests/regression/trac_bugs.php (limited to 'engine/tests') diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php new file mode 100644 index 000000000..01900b849 --- /dev/null +++ b/engine/tests/regression/trac_bugs.php @@ -0,0 +1,66 @@ +ia = elgg_set_ignore_access(TRUE); + parent::__construct(); + + // all __construct() code should come after here + } + + /** + * Called before each test method. + */ + public function setUp() { + + } + + /** + * Called after each test method. + */ + public function tearDown() { + // do not allow SimpleTest to interpret Elgg notices as exceptions + $this->swallowErrors(); + } + + /** + * Called after each test object. + */ + public function __destruct() { + elgg_set_ignore_access($this->ia); + // all __destruct() code should go above here + parent::__destruct(); + } + + /** + * #1558 + */ + public function testElggObjectClearAnnotations() { + $this->entity = new ElggObject(); + $guid = $this->entity->save(); + + $this->entity->annotate('test', 'hello', ACCESS_PUBLIC); + + $this->entity->clearAnnotations('does not exist'); + + $num = $this->entity->countAnnotations('test'); + + //$this->assertIdentical($num, 1); + $this->assertEqual($num, 1); + + // clean up + $this->entity->delete(); + } +} -- cgit v1.2.3