function TrackerTest::testTrackerAll in Drupal 7
Tests for the presence of nodes on the global tracker listing.
File
- modules/
tracker/ tracker.test, line 49 - Tests for tracker.module.
Class
- TrackerTest
- Defines a base class for testing 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, 'Unpublished node do not show up in the tracker listing.');
$this
->assertText($published->title, 'Published node show up in the tracker listing.');
$this
->assertLink(t('My recent content'), 0, '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, 'Deleted node do not show up in the tracker listing.');
}