You are here

function NodequeueWebTestCase::createNodequeue in Nodequeue 7.2

Same name and namespace in other branches
  1. 6.2 tests/nodequeue.test \NodequeueWebTestCase::createNodequeue()

@internal param int $rid The role ID allowed to manipulate this queue.

Parameters

array $types: An array of content types that can be put in the queue.

array $rids:

int $size: The size of the queue, 0 for infinite.

bool $reverse: Reverse the queue in the admin view.

string $owner:

Return value

object A nodequeue object.

35 calls to NodequeueWebTestCase::createNodequeue()
NodequeueAdministerTestCase::testNodequeueAddNode in tests/nodequeue.test
NodequeueAdministerTestCase::testNodequeueDeleteConfirm in tests/nodequeue.test
NodequeueAdministerTestCase::testNodequeueEditForm in tests/nodequeue.test
NodequeueAdministerTestCase::testNodequeueMenuTab in tests/nodequeue.test
NodequeueAdministerTestCase::testNodequeueModifyLabel in tests/nodequeue.test

... See full list

File

tests/nodequeue.test, line 58
Tests for the Nodequeue module.

Class

NodequeueWebTestCase
Class with common helper methods.

Code

function createNodequeue($types, $rids = array(
  2,
), $size = 10, $reverse = FALSE, $owner = 'nodequeue') {
  $queue = new stdClass();
  $queue->title = $this
    ->randomName();
  $queue->name = str_replace(' ', '_', trim($queue->title));
  $queue->subqueue_title = '';
  $queue->size = $size;
  $queue->reverse = $reverse;
  $queue->types = array(
    'page',
    'article',
  );
  $queue->roles = $rids;
  $queue->add_subqueue = array(
    0 => $queue->title,
  );
  $queue->link = 'Add to ' . $queue->title;
  $queue->link_remove = 'Remove from ' . $queue->title;
  $queue->show_in_links = TRUE;
  $queue->show_in_tab = TRUE;
  $queue->show_in_ui = TRUE;
  $queue->i18n = TRUE;
  $queue->reference = 0;
  $queue->owner = $owner;
  $queue->new = TRUE;
  $queue->unique_entries = FALSE;
  $queue->insert_at_front = 0;
  $queue->reverse = 0;
  $qid = nodequeue_save($queue);
  $this
    ->assertTrue(is_numeric($qid), t('Nodequeue was created and assigned a qid.'), t('Nodequeue'));
  return $queue;
}