public function MerciLineItemUITest::testMerciLineItemUIConflict in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
Test general edit form fields of an order.
File
- merci_line_item/
tests/ merci_line_item_ui.test, line 71 - Functional tests for the merci_line_item UI module.
Class
- MerciLineItemUITest
- Functional tests for the merci_line_item UI module.
Code
public function testMerciLineItemUIConflict() {
// 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'));
$this
->assertText(t("Product One is already reserved by"));
// 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]' => '1:00pm',
MERCI_CHECKOUT_DATES . '[und][0][value2][date]' => date('m/d/Y'),
MERCI_CHECKOUT_DATES . '[und][0][value2][time]' => '2: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'));
$this
->assertText(t("Line item saved."));
}