formatValue($dateTime); self::assertEquals('14:30', $result); } public function testFormatValueReturnsNullForNullValue(): void { $formatter = new TimeFormatter(); $result = $formatter->formatValue(null); self::assertNull($result); } public function testFormatValueThrowsExceptionForNonDateTimeInterface(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only DateTimeInterface can be formatted'); $formatter = new TimeFormatter(); $formatter->formatValue('not a DateTime'); } }