aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-08 22:35:01 -0400
committerCash Costello <cash.costello@gmail.com>2011-10-08 22:35:01 -0400
commitb2cbd24e9af7aab7130c3cbf732043e3aa6477c3 (patch)
tree70c307ccfc3a51b265618d87c3b52f3a5cc7af7b
parent99a8c831f9487f2c99dd6467eb8dc48ea2d54883 (diff)
downloadelgg-b2cbd24e9af7aab7130c3cbf732043e3aa6477c3.tar.gz
elgg-b2cbd24e9af7aab7130c3cbf732043e3aa6477c3.tar.bz2
Fixes #3946 deleting the temporary entities created in entity unit tests
-rw-r--r--engine/tests/objects/entities.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index c0a7b96b3..49b1764bc 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -278,6 +278,10 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->$name = $md;
$this->assertEqual($md, $this->entity->$name);
+
+ if ($save) {
+ $this->assertTrue($this->entity->delete());
+ }
}
}
@@ -292,6 +296,10 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->$name = $md;
$this->assertEqual($md[0], $this->entity->$name);
+
+ if ($save) {
+ $this->assertTrue($this->entity->delete());
+ }
}
}
@@ -307,6 +315,10 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->setMetaData($name, 'test2', '', true);
$this->assertEqual(array('test', 'test2'), $this->entity->$name);
+
+ if ($save) {
+ $this->assertTrue($this->entity->delete());
+ }
}
}
@@ -322,6 +334,10 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->setMetaData($name, array('test2'), '', true);
$this->assertEqual(array('test', 'test2'), $this->entity->$name);
+
+ if ($save) {
+ $this->assertTrue($this->entity->delete());
+ }
}
}
@@ -338,11 +354,14 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->setMetaData($name, $md2, '', true);
$this->assertEqual(array_merge($md, $md2), $this->entity->$name);
+
+ if ($save) {
+ $this->assertTrue($this->entity->delete());
+ }
}
}
- protected function save_entity($type='site')
- {
+ protected function save_entity($type='site') {
$this->entity->type = $type;
$this->assertNotEqual($this->entity->save(), 0);
}