function TrackerTest::testTrackerAll

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

File

drupal/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php, line 62
Definition of Drupal\tracker\Tests\TrackerTest.

Class

TrackerTest
Defines a base class for testing tracker.module.

Namespace

Drupal\tracker\Tests

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
    ->label(), 'Unpublished node do not show up in the tracker listing.');
  $this
    ->assertText($published
    ->label(), '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
    ->label(), 'Deleted node do not show up in the tracker listing.');
}