formatValue($date); self::assertEquals('2023-10-01', $result); } public function testFormatValueReturnsNullForNullValue(): void { $formatter = new DateFormatter(); $result = $formatter->formatValue(null); self::assertNull($result); } public function testFormatValueThrowsExceptionForNonDateTime(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only DateTimeInterface can be formatted'); $formatter = new DateFormatter(); $formatter->formatValue('not a date'); } }