diff --git a/entity.test b/entity.test index f23da87..5b74105 100644 --- a/entity.test +++ b/entity.test @@ -759,15 +759,8 @@ class EntityMetadataTestCase extends EntityWebTestCase { node_save($node); $wrapper = entity_metadata_wrapper('node', $node); - // Get body's EntityValueWrapper and assert the type is correct. - $body_value = $wrapper->body->value; - $this->assertEqual('EntityValueWrapper', get_class($body_value), 'Body value is a an EntityValueWrapper type.'); - - // Test the value wrappers methods on empty values. - $this->assertEqual('Empty Calories', $wrapper->title->value(), 'Getting a title value.'); - $this->assertEqual('', $body_value->value(), "Getting empty processed value."); - $this->assertEqual('', $body_value->value(array('decode' => TRUE)), "Empty Decoded value."); - $this->assertEqual('', $body_value->raw(), "Raw empty body returned."); + // Show that dataAvailable() returns false + $this->assertFalse($wrapper->body->value->dataAvailable(), 'Body data is not available.'); $title = 'Is it bold?'; $body[LANGUAGE_NONE][0] = array('value' => 'The body & nothing.', 'summary' => 'The body.'); diff --git a/includes/entity.wrapper.inc b/includes/entity.wrapper.inc index 06b89ad..7e5f9f4 100644 --- a/includes/entity.wrapper.inc +++ b/includes/entity.wrapper.inc @@ -110,7 +110,7 @@ abstract class EntityMetadataWrapper { * @return * If we operate without any data FALSE, else TRUE. */ - protected function dataAvailable() { + public function dataAvailable() { return isset($this->data) || (isset($this->info['parent']) && $this->info['parent']->dataAvailable()); }