input = $this->createMock(OutputInterface::class); } #[Test] #[TestWith([null], 'null')] #[TestWith([''], 'empty string')] public function processDateReturnsNullForEmptyDates(string|null $date): void { $this->input->expects($this->never())->method('writeln'); self::assertNull(InputUtils::processDate('name', $date, $this->input)); } #[Test] public function processDateReturnsAtomFormatedForValidDates(): void { $date = '2025-01-20'; $this->input->expects($this->never())->method('writeln'); self::assertEquals(Chronos::parse($date)->toAtomString(), InputUtils::processDate('name', $date, $this->input)); } #[Test] public function warningIsPrintedWhenDateIsInvalid(): void { $this->input->expects($this->once())->method('writeln')->with( '> Ignored provided "name" since its value "invalid" is not a valid date. <', ); self::assertNull(InputUtils::processDate('name', 'invalid', $this->input)); } }