You are here

private function NodeViewCountViewsTest::assertStatisticsViewRowExists in Node view count 8

Assert that views row with given title and count columns values exists.

Parameters

string $title: Title of the node.

int $count: Count of views.

1 call to NodeViewCountViewsTest::assertStatisticsViewRowExists()
NodeViewCountViewsTest::testNodeViewsCountStatisticsView in src/Tests/NodeViewCountViewsTest.php
Tests Node views count statistics view.

File

src/Tests/NodeViewCountViewsTest.php, line 72

Class

NodeViewCountViewsTest
Tests views of nodeviewcount module.

Namespace

Drupal\nodeviewcount\Tests

Code

private function assertStatisticsViewRowExists($title, $count) {
  $value = $this
    ->xpath("//td[normalize-space(../td[@class='views-field views-field-title']/text()) = '{$title}'][2]");
  $value = (string) reset($value);
  $this
    ->assertEqual($value, $count);
}