diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-01 16:21:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-01 16:21:36 +0000 |
commit | 237caef7b9358b08e75145a6c4fec53ad04cb7b1 (patch) | |
tree | 5bebc1bc970f196c7ab23757404265291527ca3c /engine/tests/regression/trac_bugs.php | |
parent | ccf6312af1845f1be9c25e849a5c9d8136a7caa4 (diff) | |
download | elgg-237caef7b9358b08e75145a6c4fec53ad04cb7b1.tar.gz elgg-237caef7b9358b08e75145a6c4fec53ad04cb7b1.tar.bz2 |
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
Diffstat (limited to 'engine/tests/regression/trac_bugs.php')
-rw-r--r-- | engine/tests/regression/trac_bugs.php | 66 |
1 files changed, 66 insertions, 0 deletions
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 @@ +<?php +/** + * Elgg Regression Tests -- Trac Bugfixes + * Any bugfixes from Trac that require testing belong here. + * + * @package Elgg + * @subpackage Test + * @author Curverider Ltd + * @link http://elgg.org/ + */ +class ElggCoreRegressionBugsTest extends ElggCoreUnitTest { + + /** + * Called before each test object. + */ + public function __construct() { + $this->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(); + } +} |