You are here

function MerciBucketTestCase::testMerciTooManyBuckets in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 tests/merci_bucket.test \MerciBucketTestCase::testMerciTooManyBuckets()

File

tests/merci_bucket.test, line 65

Class

MerciBucketTestCase

Code

function testMerciTooManyBuckets() {

  // Login the merci user.
  $this
    ->drupalLogin($this->merci_user);

  // Create our first reservation
  $item = $this->bucket1;

  // Create a reservation for tomorrow.
  $day = date('Y-m-d', time() + 3600 * 24);
  $edit = array(
    'title' => $this
      ->randomName(),
    'field_merci_date[und][0][value][date]' => $day,
    'field_merci_date[und][0][value][time]' => '09:15',
    'field_merci_date[und][0][value2][date]' => $day,
    'field_merci_date[und][0][value2][time]' => '10:15',
    'merci_reservation_items[choice_1][merci_item_nid]' => $item->type,
    'merci_reservation_items[choice_2][merci_item_nid]' => $item->type,
    'merci_reservation_items[choice_3][merci_item_nid]' => $item->type,
  );
  $first = $this
    ->merciCreateNode('merci-reservation', $edit);
  $this
    ->assertText(t("You've selected too many @title", array(
    '@title' => $item->type_name,
  )));
}