function MigrateNodeCounterTest::assertNodeCounter
Asserts various aspects of a node counter.
@internal
Parameters
int $nid: The node ID.
int $total_count: The expected total count.
int $day_count: The expected day count.
int $timestamp: The expected timestamp.
1 call to MigrateNodeCounterTest::assertNodeCounter()
- MigrateNodeCounterTest::testStatisticsSettings in core/modules/ statistics/ tests/ src/ Kernel/ Migrate/ d6/ MigrateNodeCounterTest.php 
- Tests migration of node counter.
File
- 
              core/modules/ statistics/ tests/ src/ Kernel/ Migrate/ d6/ MigrateNodeCounterTest.php, line 83 
Class
- MigrateNodeCounterTest
- Tests the migration of node counter data to Drupal 8.
Namespace
Drupal\Tests\statistics\Kernel\Migrate\d6Code
protected function assertNodeCounter(int $nid, int $total_count, int $day_count, int $timestamp) : void {
  /** @var \Drupal\statistics\StatisticsViewsResult $statistics */
  $statistics = $this->container
    ->get('statistics.storage.node')
    ->fetchView($nid);
  $this->assertSame($total_count, $statistics->getTotalCount());
  $this->assertSame($day_count, $statistics->getDayCount());
  $this->assertSame($timestamp, $statistics->getTimestamp());
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
