| Total Complexity | 1 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | |||
| 16 | class StatisticsTest extends TestCase |
||
| 17 | { |
||
| 18 | public function testStatistics() |
||
| 19 | { |
||
| 20 | $date = '2018-01-01'; |
||
| 21 | $time = '01:02:03'; |
||
| 22 | $index = 'index'; |
||
| 23 | $key = 'key'; |
||
| 24 | /** @var \DateTime $timestamp */ |
||
| 25 | $timestamp = \DateTime::createFromFormat('Y-m-d H:i:s', "{$date} {$time}"); |
||
| 26 | $value = 321; |
||
| 27 | |||
| 28 | $statistics = (new Statistics()) |
||
| 29 | ->setIndex($index) |
||
| 30 | ->setKey($key) |
||
| 31 | ->setTimestamp($timestamp) |
||
| 32 | ->setValue($value); |
||
| 33 | |||
| 34 | $this->assertNull($statistics->getId()); |
||
| 35 | $this->assertSame($index, $statistics->getIndex()); |
||
| 36 | $this->assertSame($key, $statistics->getKey()); |
||
| 37 | $this->assertSame($timestamp, $statistics->getTimestamp()); |
||
| 38 | $this->assertSame($value, $statistics->getValue()); |
||
| 39 | $this->assertSame($date, $statistics->getDate()); |
||
| 40 | $this->assertSame("{$date} {$time}", $statistics->getDateTime()); |
||
| 43 |