From 82fe58de8541f2287ca28656c2121e3e3496c86f Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 6 Jan 2011 04:51:31 +0000 Subject: 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 --- engine/tests/objects/entities.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engine/tests/objects/entities.php') 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()); } -- cgit v1.2.3