function MerciIssueTestCase::testIssue1070658 in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2
Same name and namespace in other branches
- 6.2 tests/merci_issues.test \MerciIssueTestCase::testIssue1070658()
File
- tests/
merci_issues.test, line 148
Class
Code
function testIssue1070658() {
// Login the merci user.
$this
->drupalLogin($this->merci_user);
// Create our first reservation
$node = $this->bucket1;
$edit = array(
'title' => $this
->randomName(),
'field_merci_date[und][0][value][date]' => '2011-01-05',
'field_merci_date[und][0][value][time]' => '09:15',
'field_merci_date[und][0][value2][date]' => '2011-01-05',
'field_merci_date[und][0][value2][time]' => '11:15',
'merci_reservation_items[choice_1][merci_item_nid]' => $node->type,
'merci_reservation_items[choice_2][merci_item_nid]' => $node->type,
);
$first = $this
->merciCreateNode('merci-reservation', $edit);
$this
->assertText(t("@title has been created", array(
'@title' => $edit['title'],
)));
// Create merci staff user.
$staff_user = $this
->drupalCreateUser(array(
'view revisions',
'revert revisions',
'create confirmed reservations',
'edit own bucket content',
'delete own bucket content',
'edit own resource content',
'delete own resource content',
'create reservations',
//'access devel information',
'manage reservations',
'create merci_reservation content',
'edit any merci_reservation content',
'delete any merci_reservation content',
'administer nodes',
));
$this
->drupalLogin($staff_user);
$edit = array(
'merci_reservation_items[1][merci_item_nid]' => $node->nid,
'merci_reservation_items[2][merci_item_nid]' => $node->nid,
);
$fourth = $this
->merciUpdateNode($first->nid, $edit);
$this
->assertText(t("You've selected too many @name", array(
'@name' => $node->title,
)));
}