protected function CommerceReportsBaseTestCase::createProducts in Commerce Reporting 7.3
Helper function creating multiple dummy products with a variable price.
5 calls to CommerceReportsBaseTestCase::createProducts()
- CommerceReportsBaseTestCase::createOrders in tests/
commerce_reports.test - Helper function creating multiple dummy orders. If no customers or products exist, then one of each get created.
- CommerceReportsCustomerTestCase::testMultipleCustomers in tests/
commerce_reports.test - Make one customer perform multiple orders with multiple products. Then verifies if the reporting is correct.
- CommerceReportsCustomerTestCase::testSingleCustomerMultipleProducts in tests/
commerce_reports.test - Make one customer perform multiple orders with multiple products. Then verifies if the reporting is correct.
- CommerceReportsProductTestCase::testMultipleOrdersProducts in tests/
commerce_reports.test - Tests creating a multiple orders, containing multiple products with a variable quantity. Then verifies if the reporting is correct.
- CommerceReportsProductTestCase::testMultipleProducts in tests/
commerce_reports.test - Tests creating a single order, containing multiple products with a variable quantity. Then verifies if the reporting is correct.
File
- tests/
commerce_reports.test, line 25 - Unit tests for the commerce reports module.
Class
- CommerceReportsBaseTestCase
- @file Unit tests for the commerce reports module.
Code
protected function createProducts($amount = 1) {
for ($i = 0; $i < $amount; $i++) {
$product = $this
->createDummyProduct($this
->randomName(), '', rand(1, 1000));
$this->products[$product->product_id] = $product;
}
}