function MerciLineItemUITest::setUp in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
Implementation of setUp().
Overrides DrupalWebTestCase::setUp
File
- merci_line_item/
tests/ merci_line_item_ui.test, line 37 - Functional tests for the merci_line_item UI module.
Class
- MerciLineItemUITest
- Functional tests for the merci_line_item UI module.
Code
function setUp() {
$modules = parent::setUpHelper('all');
parent::setUp($modules);
// User creation for different operations.
$this->merci_admin = $this
->createMerciAdmin();
$this->merci_customer = $this
->createMerciCustomer();
// Create dummy resources.
$this->resource = $this
->createDummyProduct('PROD-01', 'Product One');
// Log in as store customer.
$this
->drupalLogin($this->merci_customer);
// Navigate to the merci line item add page.
$this
->drupalGet('merci_line_item/add/merci_line_item');
$edit = array(
MERCI_CHECKOUT_DATES . '[und][0][value][date]' => date('m/d/Y'),
MERCI_CHECKOUT_DATES . '[und][0][value][time]' => '11:00am',
MERCI_CHECKOUT_DATES . '[und][0][value2][date]' => date('m/d/Y'),
MERCI_CHECKOUT_DATES . '[und][0][value2][time]' => '12:00pm',
MERCI_RESOURCE_REFERENCE . '[und][0][target_id]' => 'Product One (' . $this->resource->product_id . ')',
);
// Create the base line_item for the rest of tests. Assign it to the normal
// user.
$this
->drupalPost(NULL, $edit, t('Save'));
}