You are here

function NodeQueueTest::test_add_node_from_node_view in Nodequeue 5.2

File

tests/nodequeue.test, line 118

Class

NodeQueueTest
This class is used to test the randomchoice module with simpletest.

Code

function test_add_node_from_node_view() {
  $nid_array = $this
    ->nodequeue_get_nids(1);
  $new_nid = 7;
  while (FALSE !== array_search($new_nid, $nid_array)) {
    $new_nid++;
  }
  $this
    ->login_nodequeue_user();
  $queue = $this
    ->nodequeue_get_info(1);
  $html = $this
    ->drupalGet('http://localhost' . url('node/' . $new_nid));
  $return = $this
    ->clickLink($queue->link);
  $new_nid_array = $this
    ->nodequeue_get_nids(1);
  $this
    ->assertEqual(count($nid_array) + 1, count($new_nid_array), '[nodequeue] Adding a new node to the queue from the node view increases the count: %s');
  $html = $this
    ->drupalGet('http://localhost' . url('node/' . $new_nid));

  // refresh!
  $return = $this
    ->clickLink($queue->link_remove);
  $new_nid_array = $this
    ->nodequeue_get_nids(1);
  $this
    ->assertEqual(count($nid_array), count($new_nid_array), '[nodequeue] Removing the new node from the queue from the node view returns the count to the original: %s');
}