function CommerceProductCRUDTestCase::testCommerceProductDefaultProducts in Commerce Core 7
Ensure the default product types are created.
File
- modules/
product/ tests/ commerce_product.test, line 32 - Unit tests for the commerce product module.
Class
- CommerceProductCRUDTestCase
- Test the product and product type CRUD.
Code
function testCommerceProductDefaultProducts() {
$default_types = array(
'product' => 'Product',
);
// Load the default product types.
$types_created = commerce_product_types();
// Ensure each type exists.
foreach ($default_types as $type => $name) {
$this
->assertTrue(!empty($types_created[$type]), 'Product type ' . check_plain($type) . ' has been created.');
}
}