public function CommercePricelistTestCase::createDummyPricelist in Commerce Pricelist 7
Create a pricelist for testing.
Parameters
string $title:
int $weight:
Return value
mixed
2 calls to CommercePricelistTestCase::createDummyPricelist()
- CommercePricelistFeedsTestCaseSimpleProduct::setUp in commerce_pricelist_feeds/
tests/ commerce_pricelist_feeds.test - Implementation of setUp().
- CommercePricelistTestCase::setUp in tests/
commerce_pricelist.test - Helper function to perform the common test tasks for price list testing.
File
- tests/
commerce_pricelist.test, line 75 - Functional tests for the commerce price list module.
Class
- CommercePricelistTestCase
- Abstract class for Commerce price list testing. All Commerce price list tests should extend this class.
Code
public function createDummyPricelist($title = '', $weight = 0) {
$new_pricelist = commerce_pricelist_list_new();
$new_pricelist->title = empty($title) ? $this
->randomName(10) : $title;
$new_pricelist->weight = $weight;
commerce_pricelist_list_save($new_pricelist);
return $new_pricelist;
}