You are here

function MerciUserTestCase::testMerciClosedDays in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 tests/merci_user.test \MerciUserTestCase::testMerciClosedDays()

File

tests/merci_user.test, line 224

Class

MerciUserTestCase

Code

function testMerciClosedDays() {

  // Create merci user.
  // Login the merci user.
  $this
    ->drupalLogin($this->merci_user);
  $closed = variable_get('merci_closed_dates', '12-25');
  $today = '2010-' . $closed;

  // Create our first reservation
  $node = $this->bucket1;
  $edit = array(
    'title' => $this
      ->randomName(),
    'field_merci_date[und][0][value][date]' => $today,
    'field_merci_date[und][0][value][time]' => '09:15',
    'field_merci_date[und][0][value2][date]' => $today,
    'field_merci_date[und][0][value2][time]' => '11:15',
    'merci_reservation_items[choice_1][merci_item_nid]' => $node->type,
  );
  $first = $this
    ->merciCreateNode('merci-reservation', $edit, FALSE);
  $this
    ->assertText(t("Sorry, but we are closed on December 25th for a holiday or special event."));
}