You are here

public function SmartqueueDomainTestCase::smartqueueDomainCreateSmartqueue in Smartqueue Domain 7

Helper function. Create a smartqueue.

Return value

The id of the created smartqueue.

1 call to SmartqueueDomainTestCase::smartqueueDomainCreateSmartqueue()
SmartqueueDomainAdminTest::testCreateSubqueues in tests/smartqueue_domain.test
Tests creation and deleted of subqueues.

File

tests/smartqueue_domain.test, line 21
Simpletest for Smartqueue domain module.

Class

SmartqueueDomainTestCase
@file Simpletest for Smartqueue domain module.

Code

public function smartqueueDomainCreateSmartqueue() {

  // The identifier for this type of smartqueue.
  $queue = 'smartqueue_domain';

  // Populate and submit the form.
  $name = $this
    ->randomName(8);
  $edit = array(
    'title' => $name,
    'name' => strtolower($name),
  );
  $this
    ->drupalGet('admin/structure/nodequeue/add/' . $queue);
  $this
    ->drupalPost(NULL, $edit, format_string('Submit'));

  // Query the database for the new smartqueue id.
  $qid = db_query("SELECT qid FROM {nodequeue_queue} WHERE title = :name AND owner = :queue LIMIT 1", array(
    ':queue' => $queue,
    ':name' => $name,
  ))
    ->fetchField();
  return $qid;
}