You are here

public function NodeViewCountViewsTest::testNodeViewsCountStatisticsView in Node view count 8

Tests Node views count statistics view.

File

src/Tests/NodeViewCountViewsTest.php, line 22

Class

NodeViewCountViewsTest
Tests views of nodeviewcount module.

Namespace

Drupal\nodeviewcount\Tests

Code

public function testNodeViewsCountStatisticsView() {
  $this
    ->sendAjaxStatistics($this->firstTestTrackedNode
    ->id(), 0);
  $this
    ->sendAjaxStatistics($this->firstTestTrackedNode
    ->id(), 1);
  $this
    ->sendAjaxStatistics($this->secondTestTrackedNode
    ->id(), 0);
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/config/content/node-views-count-statistics');
  $this
    ->assertStatisticsViewRowExists($this->firstTestTrackedNode
    ->getTitle(), 2);
  $this
    ->assertStatisticsViewRowExists($this->secondTestTrackedNode
    ->getTitle(), 1);
  $this
    ->assertStatisticsViewRowExists($this->testNotTrackedNode
    ->getTitle(), 0);
  $this
    ->drupalLogout();
}