You are here

public function EntityMetadataTestCase::testWithoutData in Entity API 7

Tests using the wrapper without any data.

File

./entity.test, line 968
Entity CRUD API tests.

Class

EntityMetadataTestCase
Tests metadata wrappers.

Code

public function testWithoutData() {
  $wrapper = entity_metadata_wrapper('node', NULL, array(
    'bundle' => 'page',
  ));
  $this
    ->assertTrue(isset($wrapper->title), 'Bundle properties have been added.');
  $info = $wrapper->author->mail
    ->info();
  $this
    ->assertTrue(!empty($info) && is_array($info) && isset($info['label']), 'Property info returned.');
}