aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/objects
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-06 04:51:31 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-06 04:51:31 +0000
commit82fe58de8541f2287ca28656c2121e3e3496c86f (patch)
treecb10027d7693658b136389455c9ba7b4d9a95ecb /engine/tests/objects
parentd47a736dcd87b664a6e09540a3e605429d274911 (diff)
downloadelgg-82fe58de8541f2287ca28656c2121e3e3496c86f.tar.gz
elgg-82fe58de8541f2287ca28656c2121e3e3496c86f.tar.bz2
Refs #1242, Fixes #2775. Pulled common code between get_data() and get_data_row() into elgg_query_runner(). Caching is now done in the query runner instead of spread across execute_query() and get_data*(). Namespacing cache for callback and single row request. I'm open to better names for that function. Not closing #1242 because the elgg_get_entities*() functions can still return false.
git-svn-id: http://code.elgg.org/elgg/trunk@7849 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests/objects')
-rw-r--r--engine/tests/objects/entities.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index 56c8f7947..8e7e30c5b 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -118,7 +118,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->assertIsA($annotations[0], 'ElggAnnotation');
$this->assertIdentical($annotations[0]->name, 'non_existent');
$this->assertEqual($this->entity->countAnnotations('non_existent'), 1);
-
+
$this->assertIdentical($annotations, get_annotations($this->entity->getGUID()));
$this->assertIdentical($annotations, get_annotations($this->entity->getGUID(), 'site'));
$this->assertIdentical($annotations, get_annotations($this->entity->getGUID(), 'site', 'testing'));
@@ -127,10 +127,10 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
// clear annotation
$this->assertTrue($this->entity->clearAnnotations());
$this->assertEqual($this->entity->countAnnotations('non_existent'), 0);
-
- $this->assertIdentical(FALSE, get_annotations($this->entity->getGUID()));
- $this->assertIdentical(FALSE, get_annotations($this->entity->getGUID(), 'site'));
- $this->assertIdentical(FALSE, get_annotations($this->entity->getGUID(), 'site', 'testing'));
+
+ $this->assertIdentical(array(), get_annotations($this->entity->getGUID()));
+ $this->assertIdentical(array(), get_annotations($this->entity->getGUID(), 'site'));
+ $this->assertIdentical(array(), get_annotations($this->entity->getGUID(), 'site', 'testing'));
// clean up
$this->assertTrue($this->entity->delete());
@@ -201,30 +201,30 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->assertTrue($this->entity->enable());
$this->assertTrue($this->entity->delete());
}
-
+
public function testElggEntityMetadata() {
// let's delte a non-existent metadata
$this->assertFalse($this->entity->clearMetaData('important'));
-
+
// let's add the meatadata
$this->assertTrue($this->entity->important = 'indeed!');
$this->assertTrue($this->entity->less_important = 'true, too!');
$this->save_entity();
-
+
// test deleting incorrectly
// @link http://trac.elgg.org/ticket/2273
$this->assertFalse($this->entity->clearMetaData('impotent'));
$this->assertEqual($this->entity->important, 'indeed!');
-
+
// get rid of one metadata
$this->assertEqual($this->entity->important, 'indeed!');
$this->assertTrue($this->entity->clearMetaData('important'));
$this->assertEqual($this->entity->important, '');
-
+
// get rid of all metadata
$this->assertTrue($this->entity->clearMetaData());
$this->assertEqual($this->entity->less_important, '');
-
+
// clean up database
$this->assertTrue($this->entity->delete());
}