You are here

public function UcAddressesEntityCase::getEntityAddress in Ubercart Addresses 7

This a helper function for getting an UcAddressesAddress instance from an address entity.

Should the method for getting an address entity's UcAddressesAddress instance ever change, then this would be only place to change it in the automated tests.

Parameters

object $entity: The address entity.

Return value

UcAddressesAddress An instance of UcAddressesAddress, if it exists. Something unexpected otherwise!

1 call to UcAddressesEntityCase::getEntityAddress()
UcAddressesEntityCase::testEntityCrud in tests/uc_addresses.entity.test
Test Ubercart Addresses Entity CRUD.

File

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

Class

UcAddressesEntityCase
Tests for Entity API integration.

Code

public function getEntityAddress($entity) {
  $address = $entity;

  // Ensure an address is attached.
  $this
    ->assertTrue($address instanceof UcAddressesAddress, 'The address entity correctly contains an UcAddressesAddress instance.');
  return $address;
}