File size: 698 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Mautic\StatsBundle\Tests\Aggregate\Collection\Stats;

use Mautic\StatsBundle\Aggregate\Collection\Stats\HourStat;
use PHPUnit\Framework\TestCase;

class HourStatTest extends TestCase
{
    public function testAll(): void
    {
        $hour     = '2018-12-07 12';
        $hourStat = new HourStat('2018-12-07 12');
        $this->assertSame($hour, $hourStat->getHour());

        // Counts
        $this->assertSame(0, $hourStat->getCount());
        $count = 1;
        $hourStat->setCount($count);
        $this->assertSame($count, $hourStat->getCount());
        $count = 2;
        $hourStat->setCount($count);
        $this->assertSame($count, $hourStat->getCount());
    }
}