comparison core/modules/statistics/tests/src/Unit/StatisticsViewsResultTest.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents
children
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
1 <?php
2
3 namespace Drupal\Tests\statistics\Unit;
4
5 use Drupal\statistics\StatisticsViewsResult;
6 use Drupal\Tests\UnitTestCase;
7
8 /**
9 * @coversDefaultClass \Drupal\statistics\StatisticsViewsResult
10 * @group statistics
11 */
12 class StatisticsViewsResultTest extends UnitTestCase {
13
14 /**
15 * Tests migration of node counter.
16 *
17 * @covers ::__construct
18 *
19 * @dataProvider providerTestStatisticsCount
20 */
21 public function testStatisticsCount($total_count, $day_count, $timestamp) {
22 $statistics = new StatisticsViewsResult($total_count, $day_count, $timestamp);
23 $this->assertSame((int) $total_count, $statistics->getTotalCount());
24 $this->assertSame((int) $day_count, $statistics->getDayCount());
25 $this->assertSame((int) $timestamp, $statistics->getTimestamp());
26 }
27
28 public function providerTestStatisticsCount() {
29 return [
30 [2, 0, 1421727536],
31 [1, 0, 1471428059],
32 [1, 1, 1478755275],
33 ['1', '1', '1478755275'],
34 ];
35 }
36
37 }