function MigrateNodeCounterTest::assertNodeCounter
Same name in this branch
- 11.x core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d6\MigrateNodeCounterTest::assertNodeCounter()
Same name in other branches
- 9 core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d6\MigrateNodeCounterTest::assertNodeCounter()
- 9 core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d7\MigrateNodeCounterTest::assertNodeCounter()
- 8.9.x core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d6\MigrateNodeCounterTest::assertNodeCounter()
- 8.9.x core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d7\MigrateNodeCounterTest::assertNodeCounter()
- 10 core/modules/statistics/tests/src/Kernel/Migrate/d6/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d6\MigrateNodeCounterTest::assertNodeCounter()
- 10 core/modules/statistics/tests/src/Kernel/Migrate/d7/MigrateNodeCounterTest.php \Drupal\Tests\statistics\Kernel\Migrate\d7\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/ d7/ MigrateNodeCounterTest.php - Tests migration of node counter.
File
-
core/
modules/ statistics/ tests/ src/ Kernel/ Migrate/ d7/ MigrateNodeCounterTest.php, line 81
Class
- MigrateNodeCounterTest
- Tests the migration of node counter data to Drupal 8.
Namespace
Drupal\Tests\statistics\Kernel\Migrate\d7Code
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.