public function MerciBaseTesterTestCase::_testTestCreateDummyProductNode in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
Test the createDummyProductNode function.
File
- merci_core/
tests/ merci_base.test, line 868 - Defines abstract base test class for the Merci module tests.
Class
- MerciBaseTesterTestCase
- Test class to test the MerciBaseTestCase functions. All testTestFoo functions have "testTest" in the name to indicate that they are verifying that a test is working. Somewhat "meta" to do this, but it eases test development.
Code
public function _testTestCreateDummyProductNode() {
// Create a dummy product display content type
$this
->createDummyProductDisplayContentType();
// Create dummy product display nodes (and their corresponding product
// entities)
$sku = 'PROD-01';
$product_name = 'Product One';
$product = $this
->createDummyProduct($sku, $product_name);
$product_node = $this
->createDummyProductNode(array(
$product->product_id,
), $product_name);
$this
->drupalLogin($this->site_admin);
$this
->drupalGet("node/{$product_node->nid}");
$this
->assertText($product_name, t('Product !product_name created successfully', array(
'!product_name' => $product_name,
)));
}