FixedClockTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNow() 0 7 1
A testImplementsClockInterface() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\DateTime\Psr;
6
7
use Arp\DateTime\Psr\FixedClock;
8
use PHPUnit\Framework\TestCase;
9
use Psr\Clock\ClockInterface;
10
11
/**
12
 * @covers \Arp\DateTime\Psr\FixedClock
13
 */
14
final class FixedClockTest extends TestCase
15
{
16
    public function testImplementsClockInterface(): void
17
    {
18
        $this->assertInstanceOf(ClockInterface::class, new FixedClock(new \DateTimeImmutable()));
19
    }
20
21
    public function testNow(): void
22
    {
23
        $dateTimeImmutable = new \DateTimeImmutable();
24
25
        $clock = new FixedClock($dateTimeImmutable);
26
27
        $this->assertSame($dateTimeImmutable, $clock->now());
28
    }
29
}
30