You are here

public function MerciEntityRefBehaviorTest::testMerciLineItemUIConflict in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Test general edit form fields of an order.

File

merci_entityref_behavior/tests/merci_entityref_behavior.test, line 108
Functional tests for the merci_line_item UI module.

Class

MerciEntityRefBehaviorTest
Functional tests for the merci_line_item UI module.

Code

public function testMerciLineItemUIConflict() {

  // Log in as store customer.

  //$this->drupalLogin($this->merci_customer);
  $this
    ->drupalLogin($this->site_admin);

  // Navigate to the merci line item add page.
  $this
    ->drupalGet('node/add/reservation');
  $edit = array(
    'title' => $this
      ->randomName(8),
    'field_merci_checkout_dates' . '[und][0][value][date]' => date('m/d/Y'),
    'field_merci_checkout_dates' . '[und][0][value][time]' => '11:00',
    'field_merci_checkout_dates' . '[und][0][value2][date]' => date('m/d/Y'),
    'field_merci_checkout_dates' . '[und][0][value2][time]' => '12:00',
    'field_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('node/add/reservation');
  $edit = array(
    'title' => $this
      ->randomName(8),
    'field_merci_checkout_dates' . '[und][0][value][date]' => date('m/d/Y'),
    'field_merci_checkout_dates' . '[und][0][value][time]' => '15:00',
    'field_merci_checkout_dates' . '[und][0][value2][date]' => date('m/d/Y'),
    'field_merci_checkout_dates' . '[und][0][value2][time]' => '16:00',
    'field_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("has been created."));
}