You are here

protected static function UbercartAttributeTestCase::attributeFieldsToTest in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_attribute/tests/uc_attribute.test \UbercartAttributeTestCase::attributeFieldsToTest()

Returns an array of available fields for product or class attributes.

Parameters

$type:

1 call to UbercartAttributeTestCase::attributeFieldsToTest()
UbercartAttributeTestCase::testAttributeAPI in uc_attribute/uc_attribute.test
Tests the basic attribute API.

File

uc_attribute/uc_attribute.test, line 785
Ubercart Attribute Tests

Class

UbercartAttributeTestCase
SimpleTests for the Ubercart Attributes API.

Code

protected static function attributeFieldsToTest($type = '') {
  $fields = array(
    'aid',
    'name',
    'ordering',
    'required',
    'display',
    'description',
    'label',
  );
  switch ($type) {
    case 'product':
    case 'class':
      $info = uc_attribute_type_info($type);
      $fields = array_merge($fields, array(
        $info['id'],
      ));
      break;
  }
  return $fields;
}