FixedClockTest::testNow()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
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