You are here

protected function EntityMetadataIntegrationTestCase::assertValue in Entity API 7

5 calls to EntityMetadataIntegrationTestCase::assertValue()
EntityMetadataIntegrationTestCase::testComments in ./entity.test
Test properties of a comment.
EntityMetadataIntegrationTestCase::testNodeProperties in ./entity.test
Test all properties of a node.
EntityMetadataIntegrationTestCase::testSystemProperties in ./entity.test
Test properties provided by system module.
EntityMetadataIntegrationTestCase::testTaxonomyProperties in ./entity.test
Tests properties provided by the taxonomy module.
EntityMetadataIntegrationTestCase::testUserProperties in ./entity.test
Test all properties of a user.

File

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

Class

EntityMetadataIntegrationTestCase
Tests provided entity property info of the core modules.

Code

protected function assertValue($wrapper, $key) {
  $this
    ->assertTrue($wrapper->{$key}
    ->value() !== NULL, check_plain($key) . ' property returned.');
  $info = $wrapper->{$key}
    ->info();
  if (!empty($info['raw getter callback'])) {

    // Also test getting the raw value.
    $this
      ->assertTrue($wrapper->{$key}
      ->raw() !== NULL, check_plain($key) . ' raw value returned.');
  }
}