You are here

protected function AdvPollTestBase::closePoll in Advanced Poll 7.3

Close the poll with the given node id.

Parameters

int $poll_id: The node ID of the poll to close.

File

tests/AdvPollTestBase.test, line 143
Advanced Poll Test Base.

Class

AdvPollTestBase
@file Advanced Poll Test Base.

Code

protected function closePoll($poll_id) {

  // Load the poll node.
  $node = node_load($poll_id);

  // Return FALSE if node wasn't loaded or we loaded the wrong type.
  if (empty($node) || $node->type != 'advpoll') {
    return FALSE;
  }

  // Close the poll.
  $node->advpoll_closed[LANGUAGE_NONE][0]['value'] = 'closed';

  // Save the node.
  return node_save($node);
}