StatisticsDeprecationsTest.php in Drupal 8
File
core/modules/statistics/tests/src/Kernel/StatisticsDeprecationsTest.php
View source
<?php
namespace Drupal\Tests\statistics\Kernel;
use Drupal\KernelTests\KernelTestBase;
class StatisticsDeprecationsTest extends KernelTestBase {
public static $modules = [
'statistics',
];
public function testStatisticsGetDeprecation() {
$this
->installSchema('statistics', 'node_counter');
$this->container
->get('statistics.storage.node')
->recordView(1);
$expected_timestamp = $this->container
->get('datetime.time')
->getRequestTime();
$this
->assertSame([
'totalcount' => 1,
'daycount' => 1,
'timestamp' => $expected_timestamp,
], statistics_get(1));
}
}