protected function UbercartTestHelper::createProductClass in Ubercart 7.3
Same name and namespace in other branches
- 6.2 uc_store/uc_store.test \UbercartTestHelper::createProductClass()
Creates a new product class.
Fix this after adding a proper API call for saving a product class.
6 calls to UbercartTestHelper::createProductClass()
- UbercartAttributeTestCase::testAttributeAPI in uc_attribute/
tests/ uc_attribute.test - Tests the basic attribute API.
- UbercartAttributeTestCase::testAttributeUIClassAttributeAdd in uc_attribute/
tests/ uc_attribute.test - Tests the "add product class attribute option" user interface.
- UbercartAttributeTestCase::testAttributeUIClassAttributeOptionOverview in uc_attribute/
tests/ uc_attribute.test - Tests the product class attribute option user interface.
- UbercartAttributeTestCase::testAttributeUIClassAttributeOverview in uc_attribute/
tests/ uc_attribute.test - Tests the product class attribute user interface.
- UbercartCartLinksTestCase::createCartLinksProduct in uc_cart_links/
tests/ uc_cart_links.test - Creates a product with all attribute types and options.
File
- uc_store/
tests/ uc_store.test, line 94 - Test functionality provided by uc_store.
Class
- UbercartTestHelper
- Defines a base helper class for Ubercart tests.
Code
protected function createProductClass($data = array()) {
$product_class = $data + array(
'pcid' => $this
->randomName(8),
'name' => $this
->randomName(8),
'description' => $this
->randomName(8),
);
$product_class = (object) $product_class;
drupal_write_record('uc_product_classes', $product_class);
return $product_class;
}