TrackerTest::testTrackerAll

7 tracker.test TrackerTest::testTrackerAll()
8 TrackerTest.php TrackerTest::testTrackerAll()

Tests for the presence of nodes on the global tracker listing.

File

modules/tracker/tracker.test, line 49
Tests for tracker.module.

Code

function testTrackerAll() {
  $this->drupalLogin($this->user);

  $unpublished = $this->drupalCreateNode(array(
    'title' => $this->randomName(8), 
    'status' => 0,
  ));
  $published = $this->drupalCreateNode(array(
    'title' => $this->randomName(8), 
    'status' => 1,
  ));

  $this->drupalGet('tracker');
  $this->assertNoText($unpublished->title, t('Unpublished node do not show up in the tracker listing.'));
  $this->assertText($published->title, t('Published node show up in the tracker listing.'));
  $this->assertLink(t('My recent content'), 0, t('User tab shows up on the global tracker page.'));

  // Delete a node and ensure it no longer appears on the tracker.
  node_delete($published->nid);
  $this->drupalGet('tracker');
  $this->assertNoText($published->title, t('Deleted node do not show up in the tracker listing.'));
}
Login or register to post comments