aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/objects/entities.php
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-12 15:16:52 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-12 15:16:52 +0000
commitc499b05093744813a04fe537e0b588a547f3a784 (patch)
tree00ea4ea17073e50b450d27c12fac3a18790d5e2b /engine/tests/objects/entities.php
parent6008f2d28266f9a5ca1c49bccea4a3a0766105f7 (diff)
downloadelgg-c499b05093744813a04fe537e0b588a547f3a784.tar.gz
elgg-c499b05093744813a04fe537e0b588a547f3a784.tar.bz2
Adding unit tests for the ElggObject class.
Restricting testing suite to only be run as a logged-in user. This will not allow the tests to be run from the command line, but this is already the case due to debug static. git-svn-id: http://code.elgg.org/elgg/trunk@3527 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests/objects/entities.php')
-rw-r--r--engine/tests/objects/entities.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index f3f20024b..0827fa24a 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -141,10 +141,9 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
try {
$this->entity->save();
$this->assertTrue(FALSE);
- }
- catch (Exception $e) {
+ } catch (Exception $e) {
$this->assertIsA($e, 'InvalidParameterException');
- $this->assertIdentical($e->getMessage(), 'Entity type must be set.');
+ $this->assertIdentical($e->getMessage(), elgg_echo('InvalidParameterException:EntityTypeNotSet'));
}
// set elements
@@ -152,7 +151,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->entity->non_existent = 'testing';
// save
- $this->AssertEqual($guid, 0);
+ $this->AssertEqual($this->entity->getGUID(), 0);
$guid = $this->entity->save();
$this->AssertNotEqual($guid, 0);
@@ -192,6 +191,19 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->assertTrue($this->entity->enable());
$this->assertTrue($this->entity->delete());
}
+
+ public function testElggEntityExportables() {
+ $exportables = array(
+ 'guid',
+ 'type',
+ 'subtype',
+ 'time_created',
+ 'container_guid',
+ 'owner_guid',
+ );
+
+ $this->assertIdentical($exportables, $this->entity->getExportableValues());
+ }
protected function save_entity($type='site')
{