assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime()); $this->assertSame('2012-07-04T02:14:34+00:00', $uuid->getDateTime()->format('c')); $this->assertSame('1341368074.491000', $uuid->getDateTime()->format('U.u')); } public function testGetDateTimeThrowsException(): void { $fields = Mockery::mock(FieldsInterface::class, [ 'getVersion' => 1, 'getTimestamp' => new Hexadecimal('0'), ]); $numberConverter = Mockery::mock(NumberConverterInterface::class); $codec = Mockery::mock(CodecInterface::class); $timeConverter = Mockery::mock(TimeConverterInterface::class, [ 'convertTime' => new Time('0', '1234567'), ]); $uuid = new Uuid($fields, $numberConverter, $codec, $timeConverter); $this->expectException(DateTimeException::class); $uuid->getDateTime(); } }