You are here

public function UcAddressesEntityCase::testUcAddressesPropertyGet in Ubercart Addresses 7

Tests getting uc_addresses property on an address.

@covers uc_addresses_field_get()

File

tests/uc_addresses.entity.test, line 235
Test cases address entity.

Class

UcAddressesEntityCase
Tests for Entity API integration.

Code

public function testUcAddressesPropertyGet() {
  $city = self::randomName();

  // Create a new address.
  $address = UcAddressesAddressBook::newAddress();
  $address
    ->setField('city', $city);

  // Assert that properties can be get using the Entity API's metadata wrapper.
  $address_wrapper = entity_metadata_wrapper('uc_addresses', $address);
  $this
    ->assertEqual($city, $address_wrapper->city
    ->raw());
}