aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-11-18 06:42:45 -0500
committercash <cash.costello@gmail.com>2011-11-28 21:43:59 -0500
commit3de7c03c391897f04fde7e86296221122de882f5 (patch)
treeea16aa358a70a8650eac7271d6b9f2e59792a57a
parent76be18d640fed252546fbb5da99b6dea5e127cac (diff)
downloadelgg-3de7c03c391897f04fde7e86296221122de882f5.tar.gz
elgg-3de7c03c391897f04fde7e86296221122de882f5.tar.bz2
Fixes #4108 delete() returns bool now and updated unit tests
-rw-r--r--engine/lib/entities.php2
-rw-r--r--engine/tests/objects/entities.php2
-rw-r--r--engine/tests/objects/sites.php6
-rw-r--r--engine/tests/objects/users.php2
4 files changed, 7 insertions, 5 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index fd2b0e9f9..d8db88462 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1563,7 +1563,7 @@ function delete_entity($guid, $recursive = true) {
}
}
- return $res;
+ return (bool)$res;
}
}
}
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index 06bc80a4a..1772f7c1a 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -178,7 +178,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->AssertEqual($this->entity->get('non_existent'), 'testing');
// clean up with delete
- $this->assertTrue($this->entity->delete());
+ $this->assertIdentical(true, $this->entity->delete());
}
public function testElggEntityDisableAndEnable() {
diff --git a/engine/tests/objects/sites.php b/engine/tests/objects/sites.php
index e5acbb3f9..a05074c59 100644
--- a/engine/tests/objects/sites.php
+++ b/engine/tests/objects/sites.php
@@ -66,8 +66,10 @@ class ElggCoreSiteTest extends ElggCoreUnitTest {
}
public function testElggSiteSaveAndDelete() {
- $this->assertTrue($this->site->save());
- $this->assertTrue($this->site->delete());
+ $guid = $this->site->save();
+ $this->assertIsA($guid, 'int');
+ $this->assertTrue($guid > 0);
+ $this->assertIdentical(true, $this->site->delete());
}
}
diff --git a/engine/tests/objects/users.php b/engine/tests/objects/users.php
index d1533c3d2..901d76ac0 100644
--- a/engine/tests/objects/users.php
+++ b/engine/tests/objects/users.php
@@ -138,7 +138,7 @@ class ElggCoreUserTest extends ElggCoreUnitTest {
$guid = $this->user->save();
// delete object
- $this->assertTrue($this->user->delete());
+ $this->assertIdentical(true, $this->user->delete());
// check GUID not in database
$this->assertFalse($this->fetchUser($guid));